iamcco / diagnostic-languageserver

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

How i can install this plugin by plug-install? #3

Closed utrumo closed 5 years ago

utrumo commented 5 years ago

Other coc plugins may be installed by vim-plug. How can i install diagnostic-languageserver by vim-plug too?

iamcco commented 5 years ago

this is not a plugin for coc. it's language service.

iamcco commented 5 years ago

Or you can Plug 'iamcco/diagnostic-languageserver', { 'do': 'yarn install & yarn build' } use the vim-plug to clone and compile it then use absolute path to setup coc.

utrumo commented 5 years ago

Or you can Plug 'iamcco/diagnostic-languageserver', { 'do': 'yarn install & yarn build' } use the vim-plug to clone and compile it then use absolute path to setup coc.

I have got an error: Post-update hook for diagnostic-languageserver ... Exit status: 127

iamcco commented 5 years ago

remove and use Plug 'iamcco/diagnostic-languageserver', { 'do': 'yarn install' }

utrumo commented 5 years ago

Such way does not work too:) Command "diagnostic-languageserver" of LS "sls" not found in $PATH

iamcco commented 5 years ago

use the vim-plug to clone and compile it then use absolute path to setup coc.

use absolute path

utrumo commented 5 years ago

use the vim-plug to clone and compile it then use absolute path to setup coc.

use absolute path

Could you give me an example of a command? coc-tsserver coc-tsserver was established at me by this command and perfectly works: Plug 'neoclide/coc-tsserver', {'do': 'yarn install --frozen-lockfile'}

iamcco commented 5 years ago
{
  "languageserver": {
    "dls": {
      "command": "diagnostic-languageserver",
      "args": ["--stdio"],
      "filetypes": [ "sh", "email" ], // filetypes that you want to enable this lsp
      "initializationOptions": {
        "linters": {
          ...
        },
        "filetypes": {
          ...
        }
      }
    }
  }
}

change diagnostic-languageserver to path/to/diagnostic-languageserver/bin/index.js

iamcco commented 5 years ago

this is not an coc extension therefor you can't install it like other coc extensions.

utrumo commented 5 years ago

At me earned with a full absolute path: "command": "/home/user/.vim/plugged/diagnostic-languageserver/bin/index.js" There is some opportunity to specify a relative way for example from coc plugin? Something like "command": "../../diagnostic-languageserver/bin/index.js"?

iamcco commented 5 years ago

I have send pr to fix ~/xxx extend so you can use ~/.vim/plugged/diagnostic-languageserver/bin/index.js to setup coc.

https://github.com/neoclide/coc.nvim/pull/684

utrumo commented 5 years ago

I have send pr to fix ~/xxx extend so you can use ~/.vim/plugged/diagnostic-languageserver/bin/index.js to setup coc.

neoclide/coc.nvim#684

It became so much better. thanks! :)

iamcco commented 5 years ago

I have create https://github.com/iamcco/coc-diagnostic coc extension therefor you can install it like normal coc extension

utrumo commented 5 years ago

Great! I tried, it works! So much more conveniently. I think, it is necessary to specify in documentation that settings by default do not work in itself and it is required to specify in a coc-settings.json something on it seems:

{
  "diagnostic-languageserver.filetypes": {
    "php": "phpcs"
  }
}