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
{{ message }}
Repository navigation
Clarify usage of {{value}} and cursor position after completion #82
In #81, I learned that {{}} can be used in a completion item to indicate where cursor should be placed. The protocol documentation doesn't mention that. Can it please be added? Also some related questions:
Does this apply to any TextEdit or only completion ones?
Is this something that is configured?
Would it make sense to avoid this workaround and have the TextEdit also contain an (optional) recommendation of a cursor position?
This was without any intention and we need to carefully think about how we deal with cursor positions in the protocol itself. I tried to stay away from this so far by not exposing any properties to manipulate the cursor position.
changed the title [-]Clarify usage of {{}} and cursor position after completion[/-][+]Clarify usage of {{value}} and cursor position after completion[/+]on Oct 18, 2016
See this interesting comment eclipselabs/eclipse-language-service#57 (comment) . A solution could be that placeHolderStart and placeHolderEnd should be part of the completionOptions returned with the capabilities.
Yes, but not speced yet. The 2.6.x version of the node libraries available do have preliminary support for it in the protocol.d.ts. Look at SnippetString.
Dirk Bäumer (@dbaeumer) I am looking at the CompletionItem changes on the 2.6.x node libraries for this one. CompletionItem.insertText is now defined as insertText?: string | SnippetString; Unfortunately these union types are hard to map on languages such as Java, Sven Efftinge (@svenefftinge) has been working on a solution but the options are ranging from bad to worse. Can we spec this differently than the current node library implementation so that it is easier for strongly typed folks?
Gorkem Ercan (@gorkem) for the upcoming 3.0 library I speced a TypedString which can either be a normal string or a snippet string. So for people that can't deal with OR types they can always sent a TypedString.
Activity
kaloyan-raev commentedon Oct 11, 2016
This is related to #75.
dbaeumer commentedon Oct 14, 2016
This was without any intention and we need to carefully think about how we deal with cursor positions in the protocol itself. I tried to stay away from this so far by not exposing any properties to manipulate the cursor position.
[-]Clarify usage of {{}} and cursor position after completion[/-][+]Clarify usage of {{value}} and cursor position after completion[/+]mickaelistria commentedon Oct 19, 2016
See this interesting comment eclipselabs/eclipse-language-service#57 (comment) . A solution could be that placeHolderStart and placeHolderEnd should be part of the completionOptions returned with the capabilities.
mickaelistria commentedon Oct 31, 2016
Close as dup of #82
rictic commentedon Nov 7, 2016
Mickael Istria (@mickaelistria) Did you intend to say that it's closed as a dupe of #75?
dbaeumer commentedon Nov 21, 2016
It is #75.
And we made some progress on this for the upcoming 1.8 release and it got already merged into some of the LSP client and server libraries for node.
mickaelistria commentedon Nov 22, 2016
What kind of progress were done? Anything that applies to the protocol already?
dbaeumer commentedon Nov 22, 2016
Yes, but not speced yet. The 2.6.x version of the node libraries available do have preliminary support for it in the protocol.d.ts. Look at SnippetString.
gorkem commentedon Dec 13, 2016
Dirk Bäumer (@dbaeumer) I am looking at the CompletionItem changes on the 2.6.x node libraries for this one. CompletionItem.insertText is now defined as
insertText?: string | SnippetString;Unfortunately these union types are hard to map on languages such as Java, Sven Efftinge (@svenefftinge) has been working on a solution but the options are ranging from bad to worse. Can we spec this differently than the current node library implementation so that it is easier for strongly typed folks?dbaeumer commentedon Dec 30, 2016
Gorkem Ercan (@gorkem) for the upcoming 3.0 library I speced a TypedString which can either be a normal string or a snippet string. So for people that can't deal with OR types they can always sent a TypedString.
dbaeumer commentedon Feb 6, 2017
Just for clarification. The final design uses a insertTextFormat kind but provides the same functionality as the TypeString (no or types)
gorkem commentedon Feb 8, 2017
Anton Kosyakov (@akosyakov), Sven Efftinge (@svenefftinge) does the
insertTextFormatsolution work for you?akosyakov commentedon Feb 8, 2017
Gorkem Ercan (@gorkem) yes, we've modeled it as a enum: https://github.com/eclipse/lsp4j/blob/master/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/InsertTextFormat.java