Skip to content
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

Add support for bingo #2165

Merged
merged 7 commits into from
Jan 5, 2019
Merged

Add support for bingo #2165

merged 7 commits into from
Jan 5, 2019

Conversation

jeremija
Copy link
Contributor

bingo is a fork of go-langserver, and the authors of go-langserver recommend to use bingo instead:

Note: We have deprioritized work on this language server for use in editors in favor of Google's upcoming Go language server. It is in the best interests of the community to only have a single language server. If you want to use a Go language server with your editor in the meantime, try https://github.com/saibing/bingo, which is a partial fork of this repository with fixes for Go modules and other editor bugs.

There doesn't seem to be any mention of bingo in the issues except in #2112. I was not able to make bingo work by modifying go_langserver_executable and go_langserver_options because:

  1. ale_go_langserver_options become sorted and when I try to specify --mode stdio --logfile /tmp/lspserver.log --trace it ends up being something like --mode --logfile --trace /tmp/lspserver.log stdio.
  2. there was an issue with the way ale#go#FindProjectRoot uses GOPATH to detect project root. I would always get an error:
~/src/go is out of GOPATH workspace ~/src/go, but not a go module project

from this line in bingo source.

I ended up resolving the issue by detecting the .git folder similar to ale_linters/php/langserver.vim:

function! ale_linters#go#bingo#FindProjectRoot(buffer) abort
    return ale#path#FindNearestDirectory(a:buffer, '.git')
endfunction

I am not sure if this is the best solution since I haven't been actively using Go, but it seems to be working for me.

Would appreciate any feedback!

jeremija added a commit to jeremija/dotfiles that referenced this pull request Dec 27, 2018
We use Languaga Server Protocol support provided by w0rp/ale. The
dependencies are:

-- JavaScript & TypeScript --
Run "npm install tsserver --save-dev" for any TypeScript or JavaScript
project and that should be it. Additionally, tslint and eslint can be
used, respectively.

-- Golang --
Added pull request for ale: dense-analysis/ale#2165

git clone https://github.com/saibing/bingo.git
cd bingo
go build  # or goinstall

Make sure `bingo` is available in your PATH, or edit the
`g:ale_go_bingo_executable` variable in vimrc.

-- Kotlin --
git clone https://github.com/fwcd/KotlinLanguageServer
cd KotlinLanguageServer
./gradlew build -x test

Make sure `kotlin-language-server` is available in your path. The shell
script you'll be looking for is:
`build/install/kotlin-language-server/bin/kotlin-language-server`.

Alternatively, you can edit the
`g:ale_kotlin_languageserver_executable` in `01-plugins.vim`.
let l:options = filter(split(l:options, ' '), 'empty(v:val) != 1')
let l:command = join(extend(l:executable, l:options), ' ')

return l:command

This comment was marked as resolved.

@w0rp w0rp merged commit 5bbe771 into dense-analysis:master Jan 5, 2019
@jeremija
Copy link
Contributor Author

jeremija commented Jan 5, 2019

Thanks, @w0rp!

@w0rp
Copy link
Member

w0rp commented Jan 5, 2019

Cheers! 🍻

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

Successfully merging this pull request may close these issues.

None yet

2 participants