-
Notifications
You must be signed in to change notification settings - Fork 13
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Autocomplete #166
Autocomplete #166
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Haven't tested it locally but the code lgtm. Approve to unblock
@@ -55,10 +55,10 @@ public sealed partial class CodyPackage : AsyncPackage | |||
public ILog AgentLogger; | |||
public ILog AgentNotificationsLogger; | |||
|
|||
public static IAgentService AgentService; | |||
public static IUserSettingsService UserSettingsService; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific reason why static
is used for UserSettingsService
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In GeneralOptionsPage constructor let's use:
_logger = _codyPackage.Logger;
_settingsService = _codyPackage.UserSettingsService
and remove static
from CodyPackage property:
public IUserSettingsService UserSettingsService;
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These services must be available to multiple instances of CodyProposalSource and CodyProposalSourceProvider and their initialization time is set by MEF. By making them static we are ensured easy access to these services from instances of Proposal classes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh, ok, make sense. I forgot that UserSettingsService is used in the CodyProposalSource
.
Let's only revert changes in GeneralOptionsPage to have consistent use there:
_logger = _codyPackage.Logger;
_settingsService = _codyPackage.UserSettingsService
We know that UserSettingsService
is static, but let's assume only autocomplete related classed can use it explicitly.
Tab
keyboard press (lalt+,
for rotating suggestions if there is more than one)lalt+.
)Test plan
Tab
Esc