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

Explaining why some LSP needs plugins #4993

Closed
metal3d opened this issue Apr 26, 2024 · 1 comment
Closed

Explaining why some LSP needs plugins #4993

metal3d opened this issue Apr 26, 2024 · 1 comment

Comments

@metal3d
Copy link

metal3d commented Apr 26, 2024

Is your feature request related to a problem? Please describe.
I'm using Mason to install some LSP and sometimes they need plugins for some reasons that a standard user don't understand.
For example, using sonarlint-language-server

"languageserver": {
    "sonarlint": {
      "command": "~/.local/share/nvim/mason/bin/sonarlint-language-server",
      "args": [
        "-stdio",
        "-analyzers",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonariac.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarlintomni",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarphp.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarpython.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarxml.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarjava.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarcfamily.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonargo.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarjs.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonartext.jar",
        "~/.local/share/nvim/mason/share/sonarlint-analyzers/sonarhtml.jar"
      ],
      "filetypes": [
        "go",
        "java",
        "javascript",
        "php",
        "python",
        "xml",
        "yaml",
        "html"
      ],
      "initializationOptions": {
        "extraArgs": [
          "-Dsonarlint.ls.javaHome=/usr/lib/jvm/java-19-openjdk-amd64"
        ]
      },
      "shell": true
    },

Checking the outputs from CocList services, I see that the LSP is running. But it doesn't give any information on the buffer.

Same for helm-ls.

For both, I needed to install a plugin (vim-helm, sonarlint.vim...)

It's unclear to know if we misconfigured the LSP and why nothing appears on the current file.

Note that some others LSP are OK, for example, even without coc-go, I can configure gopls in the CoC settings and it works.

Describe the solution you'd like
Maybe explaining why some LSP are running but needs specific plugin to display information. Or, if there is actually a configuration to fix this, provide the explanation ;)

Describe alternatives you've considered
At this time, no alternatives. I probably misunderstand some mechanisms of LSP and CoC.

@fannheyward
Copy link
Member

First, sonarlint.nvim didn't use coc.nvim but nvim's built-in language client.

You don't need extensions to run language server with coc.nvim, just setup with languageserver in coc-settings.json is enough. But some servers, for example sonarlint-language-server, implements some off-spec requests like sonarlint/getJavaConfig, you need an extension to send off-spec request and handle the response.

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

No branches or pull requests

2 participants