williamboman / nvim-lsp-installer

Further development has moved to https://github.com/williamboman/mason.nvim!
https://github.com/williamboman/mason.nvim
Apache License 2.0
2k stars 123 forks source link

Cannot turn on language server without `remark` locally. Run `npm install remark` to enable it #519

Closed chancez closed 2 years ago

chancez commented 2 years ago

Problem description

After adding remark_ls, it isn't working by default. Opening a markdown file results in:

Cannot turn on language server without `remark` locally. Run `npm install remark` to enable it

I tried installing remark both globally:

npm install -g remark

and in the remark-language-server node_modules:

cd ~/.local/share/nvim/lsp_servers/remark_ls/node_modules/remark-language-server/
npm install remark

But I am still getting the same error.

Neovim version (>= 0.6)

NVIM v0.6.1
Build type: Release
LuaJIT 2.1.0-beta3
Compiled by brew@HMBRW-A-001-M1-004.local

Features: +acl +iconv +tui
See ":help feature-compile"

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/opt/homebrew/Cellar/neovim/0.6.1/share/nvim"

Run :checkhealth for more info

Operating system/version

Darwin dune.local 21.1.0 Darwin Kernel Version 21.1.0: Wed Oct 13 17:33:01 PDT 2021; root:xnu-8019.41.5~1/RELEASE_ARM64_T6000 arm64

I've recently downloaded the latest plugin version of both nvim-lsp-installer and nvim-lspconfig

Affected language servers

remark_ls

Steps to reproduce

Start neovim with nvim-lsp-installer and enable remark_ls, then open any markdown file.

Actual behavior

Cannot turn on language server without `remark` locally. Run `npm install remark` to enable it

Expected behavior

remark-language-server just works on install.

LspInfo

Language client log: /Users/chancezibolski/.cache/nvim/lsp.log
 Detected filetype:   markdown

 1 client(s) attached to this buffer: 

 Client: remark_ls (id: 1, pid: 29628, bufnr: [1])
    filetypes:       markdown
    autostart:       true
    root directory:  /Users/chancezibolski/projects/work/cilium-cli
    cmd:             remark-language-server --stdio

 Configured servers list: remark_ls, sqlls, terraformls, esbonio, sumneko_lua, yamlls, jsonnet_ls, clangd, rust_analyzer, pyright, tsserver, bashls, dockerls, gopls

Healthcheck

nvim-lsp-installer: require("nvim-lsp-installer.health").check()
========================================================================
## nvim-lsp-installer report
  - OK: neovim version >= 0.6.0
  - WARNING: **Composer**: not available
  - WARNING: **PHP**: not available
  - WARNING: **julia**: not available
  - WARNING: **python3_host_prog**: not available
  - OK: **bash**: `GNU bash, version 3.2.57(1)-release (arm64-apple-darwin21)`
  - OK: **tar**: `bsdtar 3.5.1 - libarchive 3.5.1 zlib/1.2.11 liblzma/5.0.5 bz2lib/1.0.8 `
  - OK: **gzip**: `Apple gzip 352.40.6`
  - OK: **curl**: `curl 7.77.0 (x86_64-apple-darwin21.0) libcurl/7.77.0 (SecureTransport) LibreSSL/2.8.3 zlib/1.2.11 nghttp2/1.42.0`
  - WARNING: **java**: not available
  - WARNING: **javac**: not available
  - OK: **Ruby**: `ruby 2.6.8p205 (2021-07-07 revision 67951) [universal.arm64e-darwin21]`
  - OK: **sh**: `Ok`
  - OK: **wget**: `GNU Wget 1.21.3 built on darwin21.3.0.`
  - OK: **RubyGem**: `3.0.3.1`
  - OK: **Go**: `go version go1.17.3 darwin/arm64`
  - OK: **python3**: `Python 3.9.7`
  - OK: **node**: `v16.13.2`
  - OK: **npm**: `8.1.2`
  - OK: **pip3**: `pip 21.3.1 from /Users/chancezibolski/.asdf/installs/python/3.9.7/lib/python3.9/site-packages/pip (python 3.9)`

Screenshots or recordings

No response

williamboman commented 2 years ago

Hello! So if I recall correctly, the remark language server expects remark to be installed locally in the workspace/project you're currently working on. As such, installing it globally (or inside nvim-lsp-installer's install path) won't cut it. Try installing remark locally instead: npm install remark

chancez commented 2 years ago

Ah yeah that works, but unfortunately incredibly cumbersome. I'll have to see how it works upstream to see if that's something that can be fixed/changed.

chancez commented 2 years ago

https://github.com/remarkjs/remark/discussions/960 seems relevant

williamboman commented 2 years ago

:+1: I'd be happy to vendor remark in this plugin if that's a viable option (I believe it won't work today as remark expects a workspace local installation).