Using your included sample for VSCode and a skeleton method to call it (in activate, as per your code), I get the following error when trying to hover or code-complete:
ERROR Handler for textDocument/hover failed: TypeError: Cannot read property 'ensureReferencedFiles' of undefined
After looking at your code I realized that that's .projectManager that's not set in the initialize() method (line 237 in typescript-service.ts). And this seems likely due that somehow params.rootUri and/or .rootPath are not set in that call. This is of course supposed to be set from vscode on the first call to the language server.
I have some questions:
1) Is this code still supposed to work (or was it meant perhaps for an earlier version of lsp or vscode)?
2) is that part of the code still being maintained/updated? (I ask because the latest updates are from 2019, and most from 1 or 2 years before that)
3) Is there a param missing (e.g. in ClientOptions) that I'm suppose to set for the rootUri/.Path to be set explicitly?
4) Is it supposed to use a lower version of typescript (tsserver)? I'm currently at v3.15 (client & server v6.0.0) and at least 1 other (unrelated) error was created because of this (a breaking change from microsoft's typescript language service)
Any help would be welcome. Thanks.
FYI: the vscode I'm using is as follows (vscode-insider on macos/catalina):
Using your included sample for VSCode and a skeleton method to call it (in activate, as per your code), I get the following error when trying to hover or code-complete:
ERROR Handler for textDocument/hover failed: TypeError: Cannot read property 'ensureReferencedFiles' of undefined
After looking at your code I realized that that's .projectManager that's not set in the initialize() method (line 237 in typescript-service.ts). And this seems likely due that somehow params.rootUri and/or .rootPath are not set in that call. This is of course supposed to be set from vscode on the first call to the language server.
I have some questions: 1) Is this code still supposed to work (or was it meant perhaps for an earlier version of lsp or vscode)? 2) is that part of the code still being maintained/updated? (I ask because the latest updates are from 2019, and most from 1 or 2 years before that) 3) Is there a param missing (e.g. in ClientOptions) that I'm suppose to set for the rootUri/.Path to be set explicitly? 4) Is it supposed to use a lower version of typescript (tsserver)? I'm currently at v3.15 (client & server v6.0.0) and at least 1 other (unrelated) error was created because of this (a breaking change from microsoft's typescript language service)
Any help would be welcome. Thanks.
FYI: the vscode I'm using is as follows (vscode-insider on macos/catalina):
For your info, here's the stub code method I've been using: