gtache / intellij-lsp

Plugin adding Language Server Protocol support for IntelliJ
Apache License 2.0
398 stars 48 forks source link

\$ not properly escaped when applying newText completion #148

Open fabioz opened 4 years ago

fabioz commented 4 years ago

This was originally reported in: https://github.com/robocorp/robotframework-lsp/issues/73, but it seems that this is actually an issue in intellij-lsp.

In this case, the request is for a completion and the actual return is:

{
"jsonrpc": "2.0", 
"id": 32, 
"result": [{"label": "${title}", "kind": 6, "documentation": "", 
"deprecated": False, 
"preselect": False, 
"insertTextFormat": 2, 
"textEdit": {
  "range": {
    "start": {"line": 15, "character": 10},
    "end": {"line": 15, "character": 12}
  }, 
  "newText": "\${title}"
}, 
"documentationFormat": "plaintext"}]
}

Note how the $ is preceded by a \ so that it's escaped (in which case it shouldn't be considered as a placeholder).

srinivasskc commented 4 years ago

Looking forward for the fix.