-
Notifications
You must be signed in to change notification settings - Fork 997
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
feat(vscode): adding auto-import during accept inline completion item #3389
feat(vscode): adding auto-import during accept inline completion item #3389
Conversation
clients/vscode/src/Commands.ts
Outdated
|
||
commands.executeCommand("editor.action.inlineSuggest.commit"); | ||
|
||
const uri = editor.document.uri; | ||
const range = this.inlineCompletionProvider.getCurrentDisplayRange(); | ||
if (!range) { | ||
return; | ||
} |
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.
commands.executeCommand("editor.action.inlineSuggest.commit"); | |
const uri = editor.document.uri; | |
const range = this.inlineCompletionProvider.getCurrentDisplayRange(); | |
if (!range) { | |
return; | |
} | |
const range = this.inlineCompletionProvider.getCurrentDisplayRange(); | |
await commands.executeCommand("editor.action.inlineSuggest.commit"); | |
const uri = editor.document.uri; | |
if (!range) { | |
return; | |
} |
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.
Should it await
the edit action of accept inline completion?
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.
The await causes us to be unable to get the current display item because it is no longer available. I moved the part that retrieves the edited range before committing the inline suggestion. The range should always exist if a code prediction is present.
still working
Screen.Recording.2024-11-08.at.03.45.50.mov
fix #2965