redhat-developer/yaml-language-server

Server returns snippets even though client doesn't support them

puremourning opened this issue · 2 comments

The completion request always returns snippet-type completions, even if the client initialisation request doesn't claim to support them.

Logs:

  • Initialize does not include snippetSupport: true which should be interpreted as not supporting snippets (only plaintext)
2019-07-05 22:43:11,807 - DEBUG - TX: Sending message: b'Content-Length: 654\r\n\r\n{"id": "1", "jsonrpc": "2.0", "method": "initialize", "params": {"capabilities": {"textDocument": {"completion": {"completionItemKind": {"valueSet": [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25]}}, "hover": {"contentFormat": ["plaintext", "markdown"]}, "signatureHelp": {"signatureInformation": {"documentationFormat": ["plaintext", "markdown"], "parameterInformation": {"labelOffsetSupport": false}}}}}, "initializationOptions": {}, "processId": 59070, "rootPath": "/Users/ben/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd", "rootUri": "file:///Users/ben/.vim/bundle/YouCompleteMe/third_party/ycmd/ycmd"}}'
  • completion request
2019-07-05 22:46:30,803 - DEBUG - TX: Sending message: b'Content-Length: 215\r\n\r\n{"id": "4", "jsonrpc": "2.0", "method": "textDocument/completion", "params": {"position": {"character": 2, "line": 0}, "textDocument": {"uri": "file:///Users/ben/Development/lsp/yaml/tests/ansible/tasks/main.yml"}}}'
  • response (snipped)
2019-07-05 22:46:30,828 - DEBUG - RX: Received message: b'{"jsonrpc":"2.0","id":"4","result":{"items":[{"kind":10,"label":"shell","insertText":"shell: $1","insertTextFormat":2,"documentation":"","textEdit":{"range":{"start":{"line":0,"character":2},"end":{"line":0,"character":4}},"newText":"shell: $1"}},

Note: "insertTextFormat":2 is 'snippet' :

	/**
	 * The primary text to be inserted is treated as a snippet.
	 *
	 * A snippet can define tab stops and placeholders with `$1`, `$2`
	 * and `${3:foo}`. `$0` defines the final tab stop, it defaults to
	 * the end of the snippet. Placeholders with equal identifiers are linked,
	 * that is typing in one will update others too.
	 */
	export const Snippet = 2;

@evidolob , @JPinkney, I am running into same issue and I noticed that it's part of your roadmap. I don't see any milestone or due date information. Could you please let me know if you have an ETA?
Thanks!

Not entirely sure if we have an ETA at the moment, it just depends on when we get the time to make the changes. Maybe @evidolob will have a timeline when he comes back from PTO