oni icon indicating copy to clipboard operation
oni copied to clipboard

Unable to start go-langserver in Oni 0.3.6

Open endorama opened this issue 6 years ago • 5 comments

Oni Version: 0.3.6 (as downloaded from the website, deb installation) Neovim Version (Linux only): v0.3.1 Operating System: Ubuntu 16.04

Issue: Received notification for - Unhandled Rejection:Error: Unable to start language server process Please report this error.

Expected behavior: golang server to start?

Actual behavior: any kind of go code intelligence is missing

Steps to reproduce: I don't know.

Hello guys, I'm trying out Oni again after trying with 0.1.0 :)

Unfortunately it seems that the golang server cannot be started. After looking at the error I go getted go-langserver, but still no luck. I just installed Oni and opened one of my go packages.

I did read #1061, but the fix does not seem to be effective in this case.

Shell environment:

echo $PATH                                                                                                
/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/endorama/.asdf/shims:/home/endorama/.asdf/bin:/home/endorama/.dotfiles/bin:/home/endorama/.config/zplug/repos/RobertAudi/tsm/dist/bin:/home/endorama/.dotfiles/vendor/zplug/zplug/bin:/home/endorama/bin:/home/endorama/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-9-oracle/bin:/usr/lib/jvm/java-9-oracle/db/bin:/home/endorama/.dotfiles/vendor/endorama/devenv/bin:/home/endorama/go/bin
$ which go-langserver
/home/endorama/go/bin/go-langserver
$ go-langserver --version                                                                                  
v3-dev

Oni shell:

$ echo $PATH                                                                                                                                                  
/home/linuxbrew/.linuxbrew/bin:/home/linuxbrew/.linuxbrew/sbin:/home/endorama/.asdf/shims:/home/endorama/.asdf/bin:/home/endorama/.dotfiles/bin:/home/endorama/.config/
zplug/repos/RobertAudi/tsm/dist/bin:/home/endorama/.dotfiles/vendor/zplug/zplug/bin:/home/endorama/bin:/home/endorama/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sb
in:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin:/usr/lib/jvm/java-9-oracle/bin:/usr/lib/jvm/java-9-oracle/db/bin:/home/endorama/.dotfiles/vendor/endorama/
devenv/bin:/home/endorama/go/bin
$ which go-langserver                                                                                                                                         
/home/endorama/go/bin/go-langserver
$ go-langserver --version                                                                                                                                     
v3-dev

I'm reporting this due to the "Please report this error" message.

Relevant console log:

$env:ONI_CONFIG_FILE: undefined
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: html - command: /opt/Oni/resources/app/node_modules/vscode-html-languageserver-bin/htmlServerMain.js
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: go - command: go-langserver
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: python - command: pyls
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: cpp - command: clangd
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: c - command: clangd
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: css - command: /opt/Oni/resources/app/node_modules/vscode-css-languageserver-bin/cssServerMain.js
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: less - command: /opt/Oni/resources/app/node_modules/vscode-css-languageserver-bin/cssServerMain.js
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: scss - command: /opt/Oni/resources/app/node_modules/vscode-css-languageserver-bin/cssServerMain.js
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: reason - command: /opt/Oni/resources/app/node_modules/ocaml-language-server/bin/server/index.js
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: ocaml - command: /opt/Oni/resources/app/node_modules/ocaml-language-server/bin/server/index.js
/opt/Oni/resources/app/lib/browser/bundle.js:1 [Language Manager - Config] Registering info for language: haskell - command: stack
/opt/Oni/resources/app/lib/browser/bundle.js:1 TypeError: path must be a string or Buffer
    at fs.stat (fs.js:930:11)
    at fs.stat (ELECTRON_ASAR.js:290:16)
    at internal/util.js:227:26
    at v.<anonymous> (file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:336:13450)
    at Generator.next (<anonymous>)
    at file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:336:13106
    at new Promise (<anonymous>)
    at m (file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:336:12883)
    at v.pathIsDir.e [as pathIsDir] (file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:336:13400)
    at updateBranchIndicator (/opt/Oni/resources/app/vim/core/oni-plugin-git/index.js:21:51)
/opt/Oni/resources/app/vim/core/oni-plugin-git/index.js:77 [Oni.plugin.git]:  TypeError: Path must be a string. Received undefined
    at assertPath (path.js:28:11)
    at Object.dirname (path.js:1364:5)
    at updateBranchIndicator (/opt/Oni/resources/app/vim/core/oni-plugin-git/index.js:22:53)
    at <anonymous>
/opt/Oni/resources/app/lib/browser/bundle.js:1 Unhandled command: default_colors_set
t.warn @ /opt/Oni/resources/app/lib/browser/bundle.js:1
/opt/Oni/resources/app/lib/browser/bundle.js:1 Unhandled command: option_set
t.warn @ /opt/Oni/resources/app/lib/browser/bundle.js:1
/opt/Oni/resources/app/lib/browser/bundle.js:1
[LanguageClientProcess] Ending language server session
/opt/Oni/resources/app/lib/browser/bundle.js:1 [LanguageClientProcess]: Starting process via 'go-langserver'
/opt/Oni/resources/app/lib/browser/bundle.js:1 Error: spawn go-langserver ENOENT
    at _errnoException (util.js:1024:11)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:190:19)
    at onErrorNT (internal/child_process.js:372:16)
    at _combinedTickCallback (internal/process/next_tick.js:138:11)
    at process._tickCallback (internal/process/next_tick.js:180:9)
t.error @ /opt/Oni/resources/app/lib/browser/bundle.js:1
/opt/Oni/resources/app/lib/browser/bundle.js:1 Received notification for - Unhandled Rejection:Error: Unable to start language server process
Please report this error.
t.error @ /opt/Oni/resources/app/lib/browser/bundle.js:1
/opt/Oni/resources/app/lib/browser/vendor.bundle.js:161 Uncaught (in promise) Error: Unable to start language server process
    at ue.<anonymous> (file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:161:10496)
    at Generator.next (<anonymous>)
    at s (file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:161:8986)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
2/opt/Oni/resources/app/lib/browser/bundle.js:1 $env:ONI_CONFIG_FILE: undefined
/opt/Oni/resources/app/lib/browser/bundle.js:1 Error: Unable to start language server process
    at ue.<anonymous> (file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:161:10496)
    at Generator.next (<anonymous>)
    at s (file:///opt/Oni/resources/app/lib/browser/vendor.bundle.js:161:8986)
    at <anonymous>
    at process._tickCallback (internal/process/next_tick.js:188:7)
t.error @ /opt/Oni/resources/app/lib/browser/bundle.js:1
/opt/Oni/resources/app/lib/browser/bundle.js:1 [LanguageClientProcess] Ending language server session

Thank you!!

endorama avatar Feb 13 '19 20:02 endorama

Hello and welcome to the Oni repository! Thanks for opening your first issue here. To help us out, please make sure to include as much detail as possible - including screenshots and logs, if possible.

oni-bot[bot] avatar Feb 13 '19 20:02 oni-bot[bot]

I have a same problem in version 0.3.9

MacBookPro:~ $ echo $PATH
/Users/Home/.go/bin:/usr/local/opt/python/libexec/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/share/dotnet:~/.dotnet/tools:/Library/Frameworks/Mono.framework/Versions/Current/Commands:/Applications/Xamarin Workbooks.app/Contents/SharedSupport/path-bin
MacBookPro:~ $ which go-langserver 
/Users/Home/.go/bin/go-langserver
Screen Shot 2019-03-24 at 12 43 15 PM

tieuminh2510 avatar Mar 24 '19 05:03 tieuminh2510

Hi, most likely, the PATH that you see is not the same for Oni. You can try setting the command to the result of which (the full path).

TalAmuyal avatar Mar 27 '19 06:03 TalAmuyal

Thank for your helping, I will try it.

On Mar 27, 2019, at 1:56 PM, Tal Amuyal [email protected] wrote:

Hi, most likely, the PATH that you see is not the same for Oni. You can try setting the command to the result of which (the full path).

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/onivim/oni/issues/2722#issuecomment-477004730, or mute the thread https://github.com/notifications/unsubscribe-auth/AGvY1mP0e6rPHJCVJk9u9oJBd6avkHy0ks5vaxYZgaJpZM4a6KrT.

tieuminh2510 avatar Mar 27 '19 06:03 tieuminh2510

@TalAmuyal thank you!

Setting this in the preference file:

    "language.go.languageServer.command": "/home/.../go/bin/go-langserver",

made if work perfectly!

The strange thing in this is that the go-langserver is in the default GOPATH ($HOME/go/bin) binary folder, so I was expecting Oni to understand that.

Maybe is possible to add GOPATH to Oni paths automatically?

endorama avatar Mar 29 '19 11:03 endorama