iamcco / diagnostic-languageserver

diagnostic language server integrate with linters
MIT License
418 stars 28 forks source link

Yarn install doesn't make `diagnostic-languageserver` available #38

Closed TamaMcGlinn closed 3 years ago

TamaMcGlinn commented 4 years ago

After running the installation procedure in the README:

yarn global add diagnostic-languageserver

It still isn't possible to run diagnostic-languageserver from the commandline. Which is why trying to run e.g. shellcheck through diagnostic-languageserver fails with this message:

Server languageserver.dls failed to start: Launching server "languageserver.dls" using command diagnostic-languageserver failed.

To Reproduce

  1. Add CoC and diagnostic-languageserver plugins
  2. Save the following minimal config as coc-settings.json next to your vimrc file:
    {
    // diagnostic-languageserver
    "diagnostic-languageserver.filetypes": {
    "sh": "shellcheck"
    }
    }
  3. Run CocRestart

Expected behavior I expected the diagnostic messages to be shown as in the readme.

Screenshots https://imgur.com/S9nCEQG

Desktop (please complete the following information):

Log:

Does diagnostic-languageserver leave a logfile anywhere?
TamaMcGlinn commented 4 years ago

I should not that yarn run diagnostic-languageserver does work, so I tried adding an executable file called diagnostic-languageserver to /usr/bin/ with these contents:

#!/usr/bin/env bash
yarn run diagnostic-languageserver $@

Now, for the same example shell script from the readme, :CocRestart says:

Uncaught exception: Header must provide a Content-Length property.
iamcco commented 3 years ago
{
  // diagnostic-languageserver
  "diagnostic-languageserver.filetypes": {
    "sh": "shellcheck"
  }
}

This is config of coc-diagnostic instead of this LSP server. if use coc-diagnostic and it's no need to install this LSP server.

It still isn't possible to run diagnostic-languageserver from the commandline.

Have no idea, yarn should link the bin script after install.

lucax88x commented 3 years ago

Did you add global bin folder to PATH?

export PATH="$(yarn global bin):$PATH"
TamaMcGlinn commented 3 years ago

Thank you lucax88x; that's what should be added to the readme.