RLovelett / langserver-swift

A Swift implementation of the open Language Server Protocol.
Apache License 2.0
177 stars 16 forks source link

Snippets Are Not Rendering Anymore #45

Closed RLovelett closed 6 years ago

RLovelett commented 6 years ago

peek 2018-05-27 13-06

The GIF above exemplifies the issue. Notice when it injects the code Bar(x: {{1:Int}}, y: {{2: String}}) that VSCode is not treating the arguments as tab stops.

It used to do this. This might have regressed Adopt SnippetString API. Though as far as I can tell we do this already.

My best guess right now is that the LSP defines a property insertTextFormat which is of type InsertTextFormat. Currently this implementation of the LSP has no such property or type. I do not remember that being there when I originally implemented this.

Current CompletionItem Sent

Content-Type: application/vscode-jsonrpc; charset=utf8
Content-Length: 161

{"id":10,"result":[{"label":"(x: Int, y: String)","kind":4,"detail":"bar.Bar (x: Int, y: String)","insertText":"x: {{1:Int}}, y: {{2:String}}"}],"jsonrpc":"2.0"}
RLovelett commented 6 years ago
Content-Type: application/vscode-jsonrpc; charset=utf8
Content-Length: 312

{"id":2,"result":[{"label":"(x: Int, y: String)","kind":4,"detail":"bar.Bar (x: Int, y: String)","insertTextFormat":2,"insertText":"x: {{1:Int}}, y: {{2:String}}","textEdit":{"range":{"start":{"character":12,"line":3},"end":{"character":12,"line":3}},"newText":"x: {{1:Int}}, y: {{2:String}}"}}],"jsonrpc":"2.0"}

Still does not work. 🤔