You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have been trying to integrate this project as an LSP server for an editor. I've noticed that some of the completions do not have an insertText field.
Eg:
1.
How is this expected to be handled with respect to the value to be inserted?
Because inserting the label would mean a lot of redundant characters are being inserted (like in example 2, where after inserting label the code in the editor would become java.java.io instead of java.io).
The text was updated successfully, but these errors were encountered:
Well, it's a pain. First, insertText is optional, and deprecated, and falls back to label:
/**
* A string that should be inserted into a document when selecting
* this completion. When `falsy` the label is used.
*
* The `insertText` is subject to interpretation by the client side.
* Some tools might not take the string literally. For example
* VS Code when code complete is requested in this example `con<cursor position>`
* and a completion item with an `insertText` of `console` is provided it
* will only insert `sole`. Therefore it is recommended to use `textEdit` instead
* since it avoids additional client side interpretation.
*
* @deprecated Use textEdit instead.
*/
insertText?: string;
In order to get the textEdit you have to use the resolve request.
Depending on your editor, this may be difficult. As you can see VSCode actually does a text overlap check on the inserted label.
I have been trying to integrate this project as an LSP server for an editor. I've noticed that some of the completions do not have an insertText field.
Eg:
1.
How is this expected to be handled with respect to the value to be inserted?
Because inserting the label would mean a lot of redundant characters are being inserted (like in example 2, where after inserting label the code in the editor would become
java.java.io
instead ofjava.io
).The text was updated successfully, but these errors were encountered: