jaredly / reason-language-server

A language server for reason, in reason
MIT License
658 stars 84 forks source link

Error trying to use with coc-reason #422

Open octavz opened 4 years ago

octavz commented 4 years ago

I am on neovim, ubuntu 19.10, NVIM v0.5.0-384-ga2efc9cf8

Coc works find for other language servers.

I tried to install manually or with :CocInstall coc-reason

I keep getting:

[Error  - 5:11:45 PM] Request textDocument/documentHighlight failed.
  Message: /home/user/projectXXX/node_modules/bs-platform/lib/bsb.exe not found. aborting
  Code: -32603 
sandal-tan commented 4 years ago

OS X 10.15.3 NVIM v0.5.0-f8f41d0

I've run into this too. I can get around that particular message by changing into node_modules/bs-platform and then running cp darwin/* lib/, which for you would be cp linux/* lib/.

However, this only leads to another problem:

 [reason] [E] /Users/iantbaldwin/development/tic_tac_toe/node_modules/bs-
 platform/lib/bsc.exe: unknown option '-bs-no-builtin-ppx-ml'.
 Usage: bsc <options> <files>
 Options are:
 -bs-super-errors  Better error message combined with other tools
 -bs-re-out  Print compiler output in Reason syntax
 -bs-jsx  Set jsx version
 -bs-refmt  Set customized refmt path

I was able to resolve all of the above issues by setting my version of bs-platform to 7.1.1.

octavz commented 4 years ago

@sandal-tan I am already on 7.2.2, after copying binaries i get the second error indeed but I am already on 7.2.2 which looks it has that flag but still it shows the error above.

octavz commented 4 years ago

installing stuff manually works, it seems coc-vim is not updating correctly the binary

sandal-tan commented 4 years ago

@octavz I don't believe coc-reason is responsible for install bings-platform, which is the source of this error.

I manually installed bs-platform globally with: $ yarn global add bs-platform@7.1.1 In relevant projects, I edit packages.json and make sure that "bs-platform": "7.1.1" is in the devDependencies section.

With those two pinned to 7.1.1 I am not running into any issues.

dfalling commented 4 years ago

MacOS 10.15.3 NVIM v0.3.8

@octavz What's the manual install that you're doing to fix this? This broke for me also when I moved to 7.2.2. I have bs-platform installed locally, but there is no bsb.exe at bs-platform/lib. It's in bs-platform/darwin.

dfalling commented 4 years ago

I was able to fix autoformatting of files by running cp -r node_modules/bs-platform/darwin/* node_modules/bs-platform/lib. I still get a failure on the first line of every Reason file though:

src/App.re|1 col 1 error| [reason] .../node_modules/bs-platform/lib/bsc.exe: unknown option '-bs-no-builtin-ppx-ml'. [E]

dfalling commented 4 years ago

I figured this out for both of my errors. I had previously configured COC to use a language server for Reason. This is actually the part that was getting an outdated version of bs-platform and spitting out the error.

mishaszu commented 4 years ago

I have exact same problem with Ubuntu on bs-platform 7.2 & 7.3. For 7.1 seems rls works but I still have manually link bsb.exe to fix:node_modules/bs-platform/lib/bsb.exe not found. aborting. cp -r node_modules/bs-platform/darwin/* node_modules/bs-platform/lib doesn't work for me.