jupyter-lsp / jupyterlab-lsp

Coding assistance for JupyterLab (code navigation + hover suggestions + linters + autocompletion + rename) using Language Server Protocol
https://jupyterlab-lsp.readthedocs.io
BSD 3-Clause "New" or "Revised" License
1.81k stars 148 forks source link

Enhancement on page /Configuring.html #648

Open Quafadas opened 3 years ago

Quafadas commented 3 years ago

How to setup "initialise" parameters, in my case for metals.

According to the metals docs https://scalameta.org/metals/docs/integrations/new-editor#initialize

It should be possible exchange some settings on initialization, which dictate the "features" enabled, or triggered in the language kernel, for example

"compilerOptions.completionCommand" : "editor.action.triggerSuggest"

How does jupyterlab-lsp negotiate initilisation? Is is possible to sent such commands to the language server on initialisation?

krassowski commented 3 years ago

Yes. You can go to Advanced Settings Editor and configure the settings of the server (which is described in the README, here but missing from the RTD docs indeed). For metals I guess you would use something like:

{
  "language_servers": {
    "metals": {
      "serverSettings": {
        "compilerOptions.completionCommand" : "editor.action.triggerSuggest"
      }
    }
  }
}

I see how confusing this can be because when the docs says "servers configuration" it means "making your LSP server get detected properly" but users might be also interested in "configuring the LSP server options" which is not covered there. If you would like to improve the docs please feel free to open a PR.