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

VS Code tries to read 'range' field from TextEdit which is null #95

Closed
dbaeumer opened this issue Sep 13, 2016 · 8 comments
Closed

VS Code tries to read 'range' field from TextEdit which is null #95

dbaeumer opened this issue Sep 13, 2016 · 8 comments
Assignees

Comments

@dbaeumer
Copy link
Member

From @mniewrzal on September 12, 2016 10:57

  • VSCode Version: Code 1.5.1 (07d663dc1bd848161edf4cd4ce30cce410d3d877, 2016-09-08T21:34:58.760Z)
  • OS Version: Linux x64 4.7.2-201.fc24.x86_64

Steps to Reproduce:

After sending CompletionItem[] as a response for 'textDocument/completion' nothing is happening, no proposals. Developer tools console shows error.

Response for method: 'textDocument/completion':

Content-Type: application/vscode-jsonrpc; charset=utf8
Content-Length: 187

{"jsonrpc":"2.0","id":1,"result":[{"label":"abstract","kind":14,"detail":null,"documentation":null,"sortText":null,"filterText":null,"insertText":"abstract","textEdit":null,"data":null}]}

Developer tools console shows:

//usr/share/code/resources/app/out/vs/workbench/workbench.main.js:121 Cannot read property 'range' of null: TypeError: Cannot read property 'range' of null
    at asTextEdit (/home/wywrzal/git/vscode-php-intellisense/node_modules/vscode-languageclient/lib/protocolConverter.js:100:46)
    at /home/wywrzal/git/vscode-php-intellisense/node_modules/vscode-languageclient/lib/protocolConverter.js:95:67
    at set (/home/wywrzal/git/vscode-php-intellisense/node_modules/vscode-languageclient/lib/protocolConverter.js:83:13)
    at asCompletionItem (/home/wywrzal/git/vscode-php-intellisense/node_modules/vscode-languageclient/lib/protocolConverter.js:95:9)
    at Array.map (native)
    at asCompletionResult (/home/wywrzal/git/vscode-php-intellisense/node_modules/vscode-languageclient/lib/protocolConverter.js:76:26)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Copied from original issue: microsoft/vscode#11876

@felixfbecker
Copy link
Contributor

@dbaeumer This seems to be the same as #127 and broke completion support for PHP again :(

@felixfbecker
Copy link
Contributor

felixfbecker commented Feb 1, 2017

If textEdit is not send, a different property that is null causes the same error:

{
  "result": {
    "isIncomplete": true,
    "items": [
      {
        "label": "<?php",
        "kind": 14,
        "detail": null,
        "documentation": null,
        "sortText": null,
        "filterText": null,
        "insertText": null,
        "range": null,
        "additionalTextEdits": null,
        "command": null,
        "data": null
      }
    ]
  },
  "id": 3,
  "jsonrpc": "2.0"
}
shell.ts:437 Cannot read property 'title' of null: TypeError: Cannot read property 'title' of null
    at asCommand (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:222:35)
    at /Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:103:65
    at set (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:89:13)
    at asCompletionItem (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:103:9)
    at Array.map (native)
    at asCompletionResult (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:85:51)
    at process._tickCallback (internal/process/next_tick.js:103:7)

@felixfbecker
Copy link
Contributor

@dbaeumer
Copy link
Member Author

dbaeumer commented Feb 2, 2017

@felixfbecker which verison of the node library are you using ? VS Codes doesn't include the LSP node libraries so this is nothing that will be fixed by a new VS Code version.

@felixfbecker
Copy link
Contributor

@dbaeumer sorry, you are right, VS Code has nothing to do with this. I am using version 3.0.3, which is the latest version and higher than @next.

@dbaeumer
Copy link
Member Author

dbaeumer commented Feb 3, 2017

@felixfbecker is this still an issue then. The trace:

shell.ts:437 Cannot read property 'title' of null: TypeError: Cannot read property 'title' of null
    at asCommand (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:222:35)
    at /Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:103:65
    at set (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:89:13)
    at asCompletionItem (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:103:9)
    at Array.map (native)
    at asCompletionResult (/Users/felix/.vscode-insiders/extensions/felixfbecker.php-intellisense-0.0.12/node_modules/vscode-languageclient/lib/protocolConverter.js:85:51)
    at process._tickCallback (internal/process/next_tick.js:103:7)

Is on old code. The set function for example doesn't exist anymore in 3.0.3

@felixfbecker
Copy link
Contributor

@dbaeumer I am sorry, I had a wrong symlink in my extension folder. I think this can be closed.

@dbaeumer
Copy link
Member Author

dbaeumer commented Feb 6, 2017

@felixfbecker no problem. Happened to me as well :-)

Closing

@dbaeumer dbaeumer closed this as completed Feb 6, 2017
@vscodebot vscodebot bot locked and limited conversation to collaborators Nov 21, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants