-
Notifications
You must be signed in to change notification settings - Fork 263
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
Code Action: Allow enabling/disabling and improve ranking of explain #1211
Conversation
@@ -36,7 +36,6 @@ export class FixupCodeAction implements vscode.CodeActionProvider { | |||
title: 'Ask Cody to Fix', | |||
} | |||
action.diagnostics = diagnostics | |||
action.isPreferred = true |
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.
Doesn't affect our ranking, just means users can't trigger this automatically with a keyboard shortcut (wasn't happening anyway AFAICT)
@@ -27,6 +27,7 @@ export class ExplainCodeAction implements vscode.CodeActionProvider { | |||
arguments: [instruction, range], | |||
title: 'Ask Cody to Explain', | |||
} | |||
action.diagnostics = diagnostics |
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.
Means that the code action will appear right alongside the fix action, no other impact
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.
vscode/src/services/StatusBar.ts
Outdated
createFeatureToggle( | ||
'Code Actions', | ||
undefined, | ||
'Enable Cody to fix or explain errors and warnings, directly in your code.', |
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.
'Enable Cody to fix or explain errors and warnings, directly in your code.', | |
'Enable Cody fix and explain options in the Quick Fix menu', |
or:
'Enable Cody to fix or explain errors and warnings, directly in your code.', | |
'Enable Cody in the Quick Fix menu for fixing and explaining code errors and warnings', |
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.
Thanks! I like the first suggestion, will update
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.
awesome!
Not a block: is this a good place to register code action to listen for inline cofig change?
cody/vscode/src/services/InlineController.ts
Lines 76 to 89 in 0176b8c
vscode.workspace.onDidChangeConfiguration(e => { | |
const config = vscode.workspace.getConfiguration('cody') | |
if (e.affectsConfiguration('cody')) { | |
// Inline Chat | |
const enableInlineChat = config.get('inlineChat.enabled') as boolean | |
if (enableInlineChat) { | |
this.commentController = this.init() | |
return | |
} | |
this.commentController?.dispose() | |
this.commentController = null | |
this.dispose() | |
} | |
}) |
@abeatrix Thought about it but I think it's OK to just keep the basic implementation for now. Doesn't feel like users will often enable/disable inline chat, and the extra overhead of having to register/deregister the action to ensure we don't have duplicate code actions isn't worth it IMO. We can adjust if we get feedback from users that we need this |
Description
Enabled:
Disabled:
Interface:
Test plan
Tested locally, enabling and disabling through interface and manually in VS Code settings