LSP import action error

Hi there! In the Vue extension we are experiencing a problem with the LSP ability to fix missing imports.

This is the issue on GitHub.

One of the maintener of the Vue Language Server says:

It works fine in vscode.
I don’t know how to trace nova and language serve messages. =_=
It can help us to find questions.

Probably reason:

  1. Vue LSP returns wrong data or unsupport date when codeAction.
  2. Vue LSP has some wrong with special env.

Are there known issues with codeAction? Thanks!


Follow up

By upgrading to the latest version of VLS v0.7.2 we determined that there are probably some issues on the Nova client side.

Console output with v0.7.2:

Vue Language Server[11:04:53.713000] Vetur initialized

Vue Language Server[11:04:53.718000] Registering request handler for textDocument/formatting failed.

Vue Language Server[11:04:53.718000] (node:3468) UnhandledPromiseRejectionWarning: Error: Invalid parameter: registrations
Registrations must be of type Registration[]
    at /Users/tommaso/Library/Application Support/Nova/Extensions/com.tommasonegri.Vue/dependencyManagement/node_modules/vls/dist/vueServerMain.js:1:33573
    at /Users/tommaso/Library/Application Support/Nova/Extensions/com.tommasonegri.Vue/dependencyManagement/node_modules/vls/dist/vueServerMain.js:1:33868
    at Immediate.<anonymous> (/Users/tommaso/Library/Application Support/Nova/Extensions/com.tommasonegri.Vue/dependencyManagement/node_modules/vls/dist/vueServerMain.js:1:34233)
    at processImmediate (internal/timers.js:461:21)
(Use `node --trace-warnings ...` to show where the warning was created)

Vue Language Server[11:04:53.718000] (node:3468) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 2)

Vue Language Server[11:04:53.718000] (node:3468) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Vue Language Server[11:04:53.719000] Registering request handler for workspace/didChangeWorkspaceFolders failed.

Vue Language Server[11:04:53.719000] (node:3468) UnhandledPromiseRejectionWarning: Error: Invalid parameter: registrations
Registrations must be of type Registration[]
    at /Users/tommaso/Library/Application Support/Nova/Extensions/com.tommasonegri.Vue/dependencyManagement/node_modules/vls/dist/vueServerMain.js:1:33573
    at /Users/tommaso/Library/Application Support/Nova/Extensions/com.tommasonegri.Vue/dependencyManagement/node_modules/vls/dist/vueServerMain.js:1:33868
    at Immediate.<anonymous> (/Users/tommaso/Library/Application Support/Nova/Extensions/com.tommasonegri.Vue/dependencyManagement/node_modules/vls/dist/vueServerMain.js:1:34233)
    at processImmediate (internal/timers.js:461:21)

Vue Language Server[11:04:53.719000] (node:3468) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 4)

The maintainer says:

I think it’s a nova language client problem.
Relative issue:
bmewburn/vscode-intelephense#1534

Redirecting…
This request is wrong from nova language client.

1 Like

Ah, yes. Nova does not currently support the dynamic registration / registerCapability aspect of the LSP, as it’s marked as optional. We should definitely consider supporting it however. I have a feature request out for this already. Hopefully I can get to it soon!

3 Likes

Hi there! Any news on this? :smile:

2 Likes

Nothing as of yet. I haven’t had quite enough time to circle back to the Language Server support in a couple of months for additions.

Hi, are there any news yet?