LSP-json
LSP-json copied to clipboard
Incorrect snippet completions
This language server sends snippet completions like "operator": $1.
:: --> LSP-json textDocument/completion(102): {'position': {'character': 17, 'line': 9}, 'textDocument': {'uri': 'file:///Users/raoulwols/Library/Application%20Support/Sublime%20Text%203/Packages/LSP-json/Default.sublime-keymap'}}
:: <<< LSP-json 102: {'isIncomplete': False, 'items': [{'insertText': '"key"', 'label': 'key', 'kind': 10, 'documentation': '', 'textEdit': {'newText': '"key"', 'range': {'end': {'character': 18, 'line': 9}, 'start': {'character': 16, 'line': 9}}}, 'insertTextFormat': 2, 'filterText': '"key"'}, {'insertText': '"operator": $1', 'command': {'command': 'editor.action.triggerSuggest', 'title': 'Suggest'}, 'label': 'operator', 'kind': 10, 'documentation': {'value': 'The operator used to match the given `key` and the `operand`.', 'kind': 'markdown'}, 'textEdit': {'newText': '"operator": $1', 'range': {'end': {'character': 18, 'line': 9}, 'start': {'character': 16, 'line': 9}}}, 'insertTextFormat': 2, 'filterText': '"operator"'}, {'insertText': '"operand": ${1:true}', 'label': 'operand', 'kind': 10, 'documentation': '', 'textEdit': {'newText': '"operand": ${1:true}', 'range': {'end': {'character': 18, 'line': 9}, 'start': {'character': 16, 'line': 9}}}, 'insertTextFormat': 2, 'filterText': '"operand"'}, {'insertText': '"match_all": ${1:false}', 'label': 'match_all', 'kind': 10, 'documentation': {'value': 'If `true`, then the condition must evaluate to true for all selections.', 'kind': 'markdown'}, 'textEdit': {'newText': '"match_all": ${1:false}', 'range': {'end': {'character': 18, 'line': 9}, 'start': {'character': 16, 'line': 9}}}, 'insertTextFormat': 2, 'filterText': '"match_all"'}]}
The problem with that is that ST will accumulate "snippet fields" over time
The language server should instead return snippets like "operator": $0.
We should report it at https://github.com/microsoft/vscode-json-languageservice
But what is the issue with that, behavior-wise? It seems to allow jumping "after" the inserted snippet. I'm not sure in which cases it can get it in the way.
Tracked here https://github.com/microsoft/vscode-json-languageservice/issues/81
But what is the issue with that, behavior-wise? It seems to allow jumping "after" the inserted snippet. I'm not sure in which cases it can get it in the way.
IMO I don't like how I can now jump to seemingly random places with shifttab