Skip to content

Language server crashes in COC #10

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

Closed
dfalling opened this issue Nov 27, 2020 · 11 comments
Closed

Language server crashes in COC #10

dfalling opened this issue Nov 27, 2020 · 11 comments

Comments

@dfalling
Copy link

When I open a .res file, COC warns:

[coc.nvim] The "languageserver.rescript" server crashed 5 times in the last 3 minutes. The server will not be restarted.

Checking :CocInfo:

## Log of coc.nvim

2020-11-27T09:03:20.036 INFO (pid:81471) [services] - registered service "languageserver.rescript"
2020-11-27T09:03:20.058 INFO (pid:81471) [services] - registered service "diagnostic-languageserver"
2020-11-27T09:03:20.286 INFO (pid:81471) [services] - registered service "reason"
2020-11-27T09:03:20.306 INFO (pid:81471) [plugin] - coc.nvim 0.0.79-3658eda4fa initialized with node: v15.2.1 after 347ms
2020-11-27T09:03:20.313 INFO (pid:81471) [watchman] - watchman watching project: /Users/dfalling/Code/ido
2020-11-27T09:03:23.183 INFO (pid:81471) [services] - rescript state change: stopped => starting
2020-11-27T09:03:23.193 INFO (pid:81471) [language-client-index] - languageserver.rescript started with 82051
2020-11-27T09:03:23.245 INFO (pid:81471) [services] - rescript state change: starting => stopped
2020-11-27T09:03:23.246 INFO (pid:81471) [services] - rescript state change: stopped => starting
2020-11-27T09:03:23.249 INFO (pid:81471) [language-client-index] - languageserver.rescript started with 82053
2020-11-27T09:03:23.297 INFO (pid:81471) [services] - rescript state change: starting => stopped
2020-11-27T09:03:23.297 INFO (pid:81471) [services] - rescript state change: stopped => starting
2020-11-27T09:03:23.300 INFO (pid:81471) [language-client-index] - languageserver.rescript started with 82054
2020-11-27T09:03:23.350 INFO (pid:81471) [services] - rescript state change: starting => stopped
2020-11-27T09:03:23.350 INFO (pid:81471) [services] - rescript state change: stopped => starting
2020-11-27T09:03:23.354 INFO (pid:81471) [language-client-index] - languageserver.rescript started with 82055
2020-11-27T09:03:23.402 INFO (pid:81471) [services] - rescript state change: starting => stopped
2020-11-27T09:03:23.402 INFO (pid:81471) [services] - rescript state change: stopped => starting
2020-11-27T09:03:23.405 INFO (pid:81471) [language-client-index] - languageserver.rescript started with 82056
2020-11-27T09:03:23.455 INFO (pid:81471) [services] - rescript state change: starting => stopped

And :RescriptInfo

ReScript version: 8.3.3
Detected Config File: bsconfig.json
Detected Project Root: /Users/dfalling/Code/ido
Detected rescript_editor_support_exe: /Users/dfalling/.config/nvim/plugged/vim-rescript/rescript-vscode-1.0.0/extension
/server/darwin/rescript-editor-support.exe
Detected rescript_compile_exenode_modules/bs-platform/darwin/bsc.exe
Detected rescript_build_exenode_modules/bs-platform/darwin/bsb.exe

I've configured COC exactly as specified in the README.md. Any suggestions on troubleshooting this?

Thanks!

@ryyppy
Copy link
Member

ryyppy commented Nov 27, 2020

What vim-rescript version are you on?

cd ~/.config/nvim/plugged/vim-rescript
git describe

should output 1.0.1. If this is the case, try node ~/.config/nvim/plugged/vim-rescript/rescript-vscode-1.0.0/extension/server/out/server.js and see if the server starts (no output means it's working)

@dfalling
Copy link
Author

Good call! I was on 1.0.0. I just flushed that whole folder, reran :PlugInstall and it worked. Thanks!

@lessp
Copy link

lessp commented May 6, 2021

Hitting the same error:

CocConfig:

    "rescript": {
      "enable": true,
      "module": "~/.vim/plugged/vim-rescript/server/out/server.js", <-- my location for plugged
      "args": ["--node-ipc"],
      "filetypes": ["rescript"],
      "rootPatterns": ["bsconfig.json"]
    }

Package.json:

  "scripts": {
    "build": "rescript",
    "clean": "rescript clean -with-deps",
    "start": "rescript build -w"
  },
  "keywords": [
    "rescript"
  ],
  "author": "",
  "license": "MIT",
  "dependencies": {
    "rescript": "^9.1.2",
    "@rescript/react": "^0.10.2"
  }

Init.vim

Plug 'rescript-lang/vim-rescript'

Running

node ~/.vim/plugged/vim-rescript/server/out/server.js

Results in no output, as expected per

try node ~/.config/nvim/plugged/vim-rescript/rescript-vscode-1.0.0/extension/server/out/server.js and see if the server starts (no output means it's working)

~/.vim/plugged/vim-rescript master*
❯ git describe
v2.0.0-1-g8e525b2

:RescriptInfo*

ReScript version: 9.1.2                                                                                          
Editor mode: modern (using rescript.exe instead of bsc / bsb)                                                    
Detected Config File: /Users/ekander/dev/personal/rescript-presentation/bsconfig.json                            
Detected Project Root: /Users/ekander/dev/personal/rescript-presentation                                         
Detected rescript_analysis_exe: /Users/ekander/.vim/plugged/vim-rescript/server/analysis_binaries/darwin-run.exe 
Detected rescript_exe: /Users/ekander/dev/personal/rescript-presentation/node_modules/rescript/darwin/rescript.ex
e                                                                                                                
Bundled rescript server version: 1.1.1     

Any ideas?

@ryyppy
Copy link
Member

ryyppy commented May 6, 2021

@lessp can you try installing #37 and see if that works on your machine? Sorry for the issues, I missed some important files in the release.

Also make sure to update your CoC config as stated in the Changelog!

@lessp
Copy link

lessp commented May 7, 2021

Thanks @ryyppy, it doesn't crash anymore, I'm however not getting auto-completion or hover-info 🤔 Errors show up in the editor however:

image

@ryyppy ryyppy reopened this May 7, 2021
@ryyppy
Copy link
Member

ryyppy commented May 7, 2021

@lessp did you check out the latest commit in the #37 branch?
If so, what is your :CocConfig?

Bear in mind that autocomplete / typehinting only works when your file was compiled before.

@lessp
Copy link

lessp commented May 7, 2021

Thanks @ryyppy, so in my init.vim, I have:

Plug 'rescript-lang/vim-rescript', {'branch': 'patch-2-0-1'}

Do you mean I should point to the latest commit instead?

CocConfig:

    "rescript": {
      "enable": true,
      "module": "~/.vim/plugged/vim-rescript/server/out/server.js",
      "args": ["--node-ipc"],
      "filetypes": ["rescript"],
      "rootPatterns": ["bsconfig.json"]
    }

image

@lessp
Copy link

lessp commented May 7, 2021

✅ Solved

Hmm, OK, so when I explicitly went to ~/.vim/plugged/vim-rescript and checked out the patch-branch it works, seems like vim-plug didn't pick up the changes!

@ryyppy
Copy link
Member

ryyppy commented May 7, 2021

@lessp yeah probably because you need to run :PlugUpgrade or similar to trigger a pull. The next release will have a new tag, so this shouldn't happen again.

Good thing it works for you now, just waiting for @alexeygolev to confirm that it's working on his machine as well.

@ryyppy
Copy link
Member

ryyppy commented May 7, 2021

Fixed in #37

Please open a new issue if you experience any errors in the newer 2.0.1 version.

@ryyppy ryyppy closed this as completed May 7, 2021
@alexeygolev
Copy link

@lessp yeah probably because you need to run :PlugUpgrade or similar to trigger a pull. The next release will have a new tag, so this shouldn't happen again.

Good thing it works for you now, just waiting for @alexeygolev to confirm that it's working on his machine as well.

Works perfectly, sorry for the delay

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

4 participants