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

Language server warnings #640

Closed
karlaspuldaro opened this issue Jul 7, 2021 · 5 comments · Fixed by #645
Closed

Language server warnings #640

karlaspuldaro opened this issue Jul 7, 2021 · 5 comments · Fixed by #645

Comments

@karlaspuldaro
Copy link
Contributor

karlaspuldaro commented Jul 7, 2021

Description

After installing the 3.8 version along with jupyter-lsp 1.4.0, new server warnings are logged when running jupyterlab in the format:

Failed to validate commands from language server spec finder `x-language-server`: [<ValidationError: "None is not of type 'string'">]

for some of the language server specs defined here (See list below)
Command Line Output:

[W 2021-07-06 12:28:01.705 ServerApp] Failed to validate commands from language server spec finder `bash-language-server`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.705 ServerApp] Failed to validate commands from language server spec finder `dockerfile-language-server-nodejs`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.706 ServerApp] Failed to validate commands from language server spec finder `javascript-typescript-langserver`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.708 ServerApp] Failed to validate commands from language server spec finder `pyright`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.710 ServerApp] Failed to validate commands from language server spec finder `sql-language-server`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.712 ServerApp] Failed to validate commands from language server spec finder `unified-language-server`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.712 ServerApp] Failed to validate commands from language server spec finder `vscode-css-languageserver-bin`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.713 ServerApp] Failed to validate commands from language server spec finder `vscode-html-languageserver-bin`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.713 ServerApp] Failed to validate commands from language server spec finder `vscode-json-languageserver-bin`:
    [<ValidationError: "None is not of type 'string'">]
[W 2021-07-06 12:28:01.714 ServerApp] Failed to validate commands from language server spec finder `yaml-language-server`:
    [<ValidationError: "None is not of type 'string'">]

I believe this is be related to troubleshooting introduced in #634 where a new property is added to the schema but some of the server language specs are not including it.

Reproduce

  1. Install jupyterlab (3.0.14)
  2. Install jupyterlab-lsp (3.8.0) and jupyter-lsp (1.4.0)
  3. Run jupyter lab with the --debug flag and watch for warning logs

Expected behavior

Either no warnings logged for missing servers, or a way to turn them off?

Context

  • Operating System and version: MacOS Version 11.3.1
  • Browser and version: Chrome Version 91.0.4472.114
  • JupyterLab version: 3.0.14
Required: installed server extensions
    jupyter_lsp enabled
    - Validating jupyter_lsp...
      jupyter_lsp 1.4.0 OK
    jupyterlab enabled
    - Validating jupyterlab...
      jupyterlab 3.0.14 OK
    nbclassic enabled
    - Validating nbclassic...
      nbclassic  OK
Required: installed lab extensions
JupyterLab v3.0.14
my-conda-env/share/jupyter/labextensions
        bqplot v0.5.26 enabled OK (python, bqplot)
        @krassowski/jupyterlab-lsp v3.8.0 enabled OK (python, jupyterlab-lsp)
        @jupyter-widgets/jupyterlab-manager v3.0.0 enabled OK (python, jupyterlab_widgets)

Other labextensions (built into JupyterLab)
app dir: my-conda-env/share/jupyter/lab

@krassowski
Copy link
Member

krassowski commented Jul 8, 2021

Thank you. We need to improve the validator output as it is hard to tell what failed from these logs, but I believe your assessment right. An immediate solution is could be to update the schema to accept null for troubleshoot. I agree that ideally we would not be showing warnings for servers which are not installed.

@karlaspuldaro
Copy link
Contributor Author

I can help looking into this

@karlaspuldaro
Copy link
Contributor Author

karlaspuldaro commented Jul 9, 2021

Quick update on this, making troubleshoot nullable did not clear the warnings 😬
Even tho this property is not defined in the final specs definition, it is always updated in upper spec classes inutils.py.
I'm debugging the validator to find the spec key flagged as invalid.

@karlaspuldaro
Copy link
Contributor Author

karlaspuldaro commented Jul 14, 2021

@krassowski Apparently the None type warning was coming from the argv property in any NodeModuleSpec not installed.
node_module would resolve to None and passed to the argv array, so the validator would complain about the type not being a string.

There are a few ways to solve this, not sure which one is best:

  1. Accept null for argv in schema (not sure we have control over shell-args as we're using a ref there..)
  2. Update solve function to return empty string when find_node_module comes back as None
  3. (Best guess) Update argv in __call__ to be an empty array when spec is not installed since nothing will be called (same approach used in PythonModuleSpec)
  4. Any other ideas?

@krassowski
Copy link
Member

Thank you for looking into this. I agree that option 3 would be best for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants