-
Notifications
You must be signed in to change notification settings - Fork 30.1k
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
Inline chat for direct single edit application #190239
Comments
Will this PR merge in the future? |
happy to update the PR to the latest version if @jrieken will agree to have it enabled. That being said, the dedicated API could be added easily, with the provider being registered automatically for extensionHost (While allowing only the mentioned command to be called) as intermediate step, allowing then to switch the functionality in the background of the API to a separate inline Diff with edit panel. (Happy to add that in if agreed :)) |
{
// Controls whether to show inline edits in the editor.
"editor.experimentalInlineEdit.enabled": false,
} |
No |
Utilizing the Inline chat as means for showing edits.
TLDR; The Inline chat could be cheaply extended to provide In editor edits. (PR #190258 )
Intro
At the moment the experimental inline chat, provides very interesting way how to display edits that are restricted to a single file (TextEdits). And assuming that this API is something that the extension authors are interested in (e.g. see #85682 ) might provide a great addition to the extension author toolbelt.
The main benefits being (compared to Refactor Preview), that for small edits/single file edits:
At the same time, I realise that the Inline chat purpose is to Chat, but at the moment it seems that the edit preview logic is fused with the internals of the chat and can not be easily extracted.
Proposal
Extend the existing
inlineChat.start
(or introduce a new command e.g.inlineChat.showEdit
) which would allow to take inedits: vscode.TextEdit[]
(or vscode.WorkspaceEdit, and add additional checks in the inlineChat). The edits would be added to the options (which are passed to theInlineChatController
), and would modify the state flow a bit.After
INIT_UI
, break the_nextState
and Attach the edit as a new response, then continue the_nextState
withAPPLY_EDIT
If edits are provided in the options, then hide parts of the toolbar (the conversational pieces), and keep only the actions.
Done in PR #190258
Additional nice to have
VS Code version: 1.81.1
OS version: ChromeOS 114.0.5735.239
The text was updated successfully, but these errors were encountered: