eclipse-lsp4j / lsp4j

A Java implementation of the language server protocol intended to be consumed by tools and language servers implemented in Java.
https://eclipse.org/lsp4j
Other
599 stars 143 forks source link

Add `keepWhitespace` option to CompletionItem #844

Closed sdaimwood closed 1 month ago

sdaimwood commented 2 months ago

Hi there,

In 2018 the LSP protocol added a keepWhitespace option for CompletionItems to preserve whitespace and not add automatic indentation on subsequent lines based on where the completion was prompted from. See this issue and the implementation here.

A language server I help maintain would greatly benefit from being able to use that setting if it can be added to the LSP4J CompletionItem as well.

cdietrich commented 1 month ago

https://github.com/microsoft/language-server-protocol/issues/83 https://github.com/eclipse-lsp4j/lsp4j/blob/f235e91fbe2e45f62e185bbb9f6d21bed48eb2b9/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/InsertTextMode.java#L29

sdaimwood commented 1 month ago

microsoft/language-server-protocol#83

https://github.com/eclipse-lsp4j/lsp4j/blob/f235e91fbe2e45f62e185bbb9f6d21bed48eb2b9/org.eclipse.lsp4j/src/main/java/org/eclipse/lsp4j/InsertTextMode.java#L29

Thank you! I was looking for exactly this but looks like we were too far behind on our lsp4j version, working on getting up to date now.