-
Notifications
You must be signed in to change notification settings - Fork 33
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
Completions that are effectively code-generated overrides aren't inserted properly #685
Comments
Are you sure this completion comes from language server and not from IJ himself? Could you check in lsp completion returns this click snippet. |
If it comes from language server, could yiu copy paste the lsp response in the issue please. |
Yes, it's coming from the TypeScript language server. Here's the response to {
"isIncomplete": false,
"items": [
{
"label": "click",
"kind": 2,
"sortText": "11",
"filterText": "click(): void {\n $0\n}",
"insertText": "click(): void {\n $0\n}",
"insertTextFormat": 2,
"data": {
"cacheId": 87
}
}
]
} and here's the request/response for Request {
"label": "click",
"kind": 2,
"sortText": "11",
"filterText": "click(): void {\n $0\n}",
"insertText": "click(): void {\n $0\n}",
"insertTextFormat": 2,
"data": {
"cacheId": 87
}
} Response {
"label": "click",
"kind": 2,
"detail": "(method) HTMLElement.click(): void",
"documentation": {
"kind": "markdown",
"value": "Called when the element is inserted in a document"
},
"sortText": "11",
"filterText": "click(): void {\n $0\n}",
"insertText": "click(): void {\n \\$0\n\\}()$0",
"insertTextFormat": 2,
"data": {
"file": "/path/to/sourceFile.ts",
"line": 41,
"offset": 9,
"entryNames": [
"click"
]
}
} To be honest, the |
@SCWells72 I suggest that you create an issue in typescript-language-server repo. |
Pretty sure it's an issue with LSP4IJ specifically. Here's the behavior in VS Code: and here's the behavior in LSP4IJ: |
vscode don't use typescript-language-server but directly tssserver. When I see your trace it seems that the resolve response add \ which escape the snippet. |
Some LSP-provided completions are intended to behave as code generation, e.g., implementing/overriding a method from an interface/base class. When I accepted such a completion, it resulted in invalid code, e.g.,
HTMLElement.click()
in JavaScript/TypeScript which results in:Here's a demonstration of the issue:
It looks like it's just a current limited handling of templatized completion results.
The text was updated successfully, but these errors were encountered: