Skip to content
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

Merged
merged 21 commits into from
Jan 6, 2025
Merged

Autocomplete #166

merged 21 commits into from
Jan 6, 2025

Conversation

tomaszgolebiowski
Copy link
Collaborator

@tomaszgolebiowski tomaszgolebiowski commented Dec 12, 2024

  • implemented the agent protocols for autocompletions
  • inline text changes that can be accepted with the Tab keyboard press (lalt+, for rotating suggestions if there is more than one)
  • explicitly trigger completion suggestions (lalt+.)
  • user option to enable/disable Autocompletions
  • telemetry to compute CAR
  • tests

Test plan

  • Create a new solution
  • Start adding code
  • Check if 'grey code' with suggestions appears
  • Accept the suggestions by pressing Tab
  • Reject the suggestion by pressing Esc

Copy link

github-actions bot commented Dec 12, 2024

Test Results

17 tests  ±0   17 ✅ ±0   19m 44s ⏱️ + 16m 18s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    0 ❌ ±0 

Results for commit fd3be80. ± Comparison against base commit b52b944.

♻️ This comment has been updated with latest results.

Copy link
Collaborator

@abeatrix abeatrix left a 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

@tomaszgolebiowski tomaszgolebiowski merged commit 3cb8d9d into main Jan 6, 2025
6 checks passed
@tomaszgolebiowski tomaszgolebiowski deleted the tg/completions branch January 6, 2025 08:34
@@ -55,10 +55,10 @@ public sealed partial class CodyPackage : AsyncPackage
public ILog AgentLogger;
public ILog AgentNotificationsLogger;

public static IAgentService AgentService;
public static IUserSettingsService UserSettingsService;
Copy link
Collaborator

@PiotrKarczmarz PiotrKarczmarz Jan 6, 2025

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?

Copy link
Collaborator

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;

Copy link
Collaborator Author

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.

Copy link
Collaborator

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants