Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Server returns snippets even though client doesn't support them #161

Open
puremourning opened this issue Jul 5, 2019 · 2 comments
Open
Labels

Comments

@puremourning
Copy link

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;
@bhsubra
Copy link

bhsubra commented Aug 27, 2020

@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!

@JPinkney
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants