saibing / bingo

Bingo is a Go language server that speaks Language Server Protocol.
MIT License
495 stars 25 forks source link

Completion adds extra zero to the end of the line #110

Closed joncarr closed 5 years ago

joncarr commented 5 years ago

When I complete a candidate the completion adds a literal 0 to the end of the line. This behavior started after switching from go-langserver to bingo.

As an example, if I type fmt.Prin and complete Println the resulting completion is

fmt.Println(a)0

OS: ArcoLinux Editor: Emacs 26.1 Completion Backend: Company

Jackson-soft commented 5 years ago

same issue

image

saibing commented 5 years ago

@joncarr @Jackson-soft

I can't reproduce the problem in both vscode and coc.nvim, I won't use emacs, is it an issue handled by emacs lsp client?

s-kostyaev commented 5 years ago

It's issue on eglot & yasnippet side

s-kostyaev commented 5 years ago

But if change last tabstop from ${0} to $0 it will be fixed

joncarr commented 5 years ago

I don't use eglot, and I've used yasnippet for a long time without the extra zero being an issue. So I'm unsure how it's an issue with any of those.

@saibing I don't think it could be an issue with the LSP client either. I've used lsp-mode with go-langserver for a quite a while without any issue.

s-kostyaev commented 5 years ago

@joncarr before this https://github.com/saibing/bingo/pull/68

s-kostyaev commented 5 years ago

@saibing looking into https://microsoft.github.io/language-server-protocol/specification#textDocument_completion we can do that:

But if change last tabstop from ${0} to $0 it will be fixed

I can create PR if you want.

saibing commented 5 years ago

@joncarr @s-kostyaev @Jackson-soft

I have changed last tabstop from ${0} to $0. Please try the latest version bingo

joncarr commented 5 years ago

I have pulled the latest changes from master branch and installed the latest client.

git pull
GO111MODULE=on go install

And now the server will not start for me. Just spins on starting

saibing commented 5 years ago

@joncarr

please set flag: --trace, --logfile=/tmp/bingo.log, and then check /tmp/bingo.log.

s-kostyaev commented 5 years ago

@saibing fixed, thanks