coc.nvim fails to start language server with error about "unregistered dependency token ElmWorkspaces"
See original GitHub issueI’ve used coc.nvim for a while with a variety of languages and I’m trying to get started with Elm. I’ve installed this language server and its dependencies in my local node_modules directory and configured coc.nvim like so:
{
...
"elmLS": {
"command": "./assets/node_modules/.bin/elm-language-server",
"filetypes": ["elm"],
"rootPatterns": ["elm.json"],
"elmPath": "./assets/node_modules/.bin/elm",
"elmReviewPath": "./assets/node_modules/.bin/elm-review",
"elmFormatPath": "./assets/node_modules/.bin/elm-format",
"elmTestPath": "./assets/node_modules/.bin/elm-test",
},
...
}
Expected Behavior
coc.nvim starts the language server and I can write Elm code using neovim and code completion, syntax checking etc.
Current Behavior
When I start coc.nvim it gives me this message:
Server languageserver.elmLS failed to start: Pm [Error]: Request
initialize failed with message: Attempted to resolve unregistered dependency token: "ElmWorkspaces"
at su (/home/patrick/dotfiles/.config/nvim/plugged/coc.nvim/build/index.js:38:224)
lp (/home/patrick/dotfiles/.config/nvim/plugged/coc.nvim/build/index.js:37:11261)
at
at Immediate. <anonymous> (/home/patrick/dotfiles/.config/nvim/plugged/coc.nvim/build/index.js:37:11111)
at process Immediate (node: internal/timers:464:21) {
code: -32603,
data: undefined
Possible Solution
Not sure I can help here just yet. Was looking through the source of both coc.nvim and elm-language-server and it’s hard to tell where this error is even coming from. I suspect it’s from a dependency of elm-language-server.
Steps to Reproduce
- Install elm-language-server and its dependencies
- Configure coc.nvim
- Edit a Elm file
Your Environment
- Version used: 1.6.0
- Editor used: neovim 0.4.3
- Environment name and version: Node 16.3.0
- Operating System and version: Ubuntu 20.04
Issue Analytics
- State:
- Created a year ago
- Comments:7 (3 by maintainers)
Top Results From Across the Web
Error when using elm-language-server with neovim and coc
elmLS failed to start: Error: Request initialize failed with message: Attempted to resolve unregistered dependency token: "ElmWorkspaces".
Read more >coc-ember - npm
Ember language server extension for coc.nvim. Latest version: 1.5.39, last published: 5 days ago. Start using coc-ember in your project by ...
Read more >coc.nvim | Yarn - Package Manager
LSP based intellisense engine for neovim & vim8. ... When create CocSem highlight group, replace invalid character of token types and token modifiers...
Read more >neoclide/coc.nvim - Gitter
bingo will return diagnostics info and i use [C ]C to jump error. Andy Walker ... @chemzqm I still have problems with starting...
Read more >problem with coc vim and julia server - Reddit
I tried to add an autocompletion for vim but the language server crashed every time i open a julia file, this is the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
That gives me an idea… Yup, it must have been because I hadn’t created an elm.json file yet. Now that that exists in an ancestor directory to the file I’m editing the LS starts up successfully. So, user error, though in the friendly spirit of Elm perhaps the error message should be more helpful?
That’s an internal thing to the language server, you won’t know that from learning elm