-
Notifications
You must be signed in to change notification settings - Fork 903
Description
Like TypeScript, in Dart we have support for auto-importing during completions. However sometimes these imports must go in other files (when you have "part" files, the imports go in the "parent" file).
Right now we can add "additional edits" to a completion item, but only for the current file. Using the normal VS Code API, we attach a command to the completion item that takes the "other file" edits as args, and applies them.
In LSP, the equivalent of this means that our completion item will have a command with args that are the workspace edit, that will be passed from the client back to the server (to execute the command) where the server will then call applyEdits on the client, wait for it to apply the edits and return a response, then response to its request.
It feels a bit clunky for an edit to go from the server, to the client, back to the server, back to the client. It would be nice if completion items could just have workspace edits on them directly.