Giter VIP home page Giter VIP logo

bingo's People

Contributors

110y avatar alexsaveliev avatar beyang avatar contextualist avatar corpix avatar fannheyward avatar iamruinous avatar imjustfly avatar josharian avatar ka2n avatar keegancsmith avatar lindaxie-zz avatar lloiser avatar mbana avatar nezorflame avatar nicksnyder avatar nicot avatar otto-md avatar pbitty avatar pianohacker avatar ramya-rao-a avatar saibing avatar seebs avatar slimsag avatar sqs avatar svarlamov avatar uforic avatar vitreuz avatar wbbradley avatar yudai avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

bingo's Issues

completion returns snippet in nvim

I use nvim with LanguageClient-neovim, and completion wrongly returns snippet:

import "fmt"

func main() {
		fmt.Println(${1:a ...interface\{\}})  // completion returns the snippet.
}

I am not sure whether it's a bug of bingo or LanguageClient-neovim.

completion of constant has a problem

When bingo try complete a constant, it returns a full assignment statement.

Fro example:

const foo = 100

func main() {
    test := f // wait for completion
}

bingo will give me foo = 100 as a completion item instead foo:

const foo = 100

func main() {
    test := foo = 100
}

I use neovim with LanguageClient-Neovim.

go get -v github.com/saibing/bingo fails

When I try to go get bingo I get (both on 1.10.7 and 1.11.4)

go get -v github.com/saibing/bingo
...
golang.org/x/tools/imports
github.com/saibing/bingo/langserver/internal/source
github.com/saibing/bingo/langserver/internal/cache
# github.com/saibing/bingo/langserver/internal/cache
../../.gvm/pkgsets/go1.11.4/global/src/github.com/saibing/bingo/langserver/internal/cache/project.go:55:2: undefined: packages.DebugCache
../../.gvm/pkgsets/go1.11.4/global/src/github.com/saibing/bingo/langserver/internal/cache/project.go:56:2: undefined: packages.ParseFileTrace
../../.gvm/pkgsets/go1.11.4/global/src/github.com/saibing/bingo/langserver/internal/cache/project.go:269:22: p.view.Config.Cache undefined (type *packages.Config has no field or method Cache)
../../.gvm/pkgsets/go1.11.4/global/src/github.com/saibing/bingo/langserver/internal/cache/project.go:273:22: p.view.Config.Cache undefined (type *packages.Config has no field or method Cache)
../../.gvm/pkgsets/go1.11.4/global/src/github.com/saibing/bingo/langserver/internal/cache/project.go:328:35: undefined: packages.WalkFunc
../../.gvm/pkgsets/go1.11.4/global/src/github.com/saibing/bingo/langserver/internal/cache/project.go:337:22: p.view.Config.Cache undefined (type *packages.Config has no field or method Cache)
../../.gvm/pkgsets/go1.11.4/global/src/github.com/saibing/bingo/langserver/internal/cache/view.go:37:4: unknown field 'Cache' in struct literal of type packages.Config

LSP speed improvements

Currently bingo is doing full file content replacement on each change https://github.com/saibing/bingo/blob/master/langserver/internal/source/file.go#L55 and removing the whole ast tree, token and pkg. After that completion request need's to parse the whole file again which is no efficient in a lot of cases.

Simplest example

package main

import "fmt"

func main() {
   fmt.Println("hello")
   fmt.#
}

Few solutions:

  1. If I want to get autocomplete for fmt. statment there is no need to fully remove whole file ast, instead it should only add needed new nodes to existing ast tree. See astutil package
  2. Debounce input and implement cancelation. If I quickly type fmt I will get 3 requests to lang server. Debounce can reduce overhead a lot.

There is a lot more cases then file ast should not be fully removed. Issues #21 and #14 are mostly occurs due to this issue.

At the moment I'm investigating how Typescript LSP is handling file changes since it works super fast. If you look at https://github.com/Microsoft/TypeScript/blob/master/src/services/textChanges.ts there is tons of cases for such performance improvements.

configuring formatting/linting

Hello,
let me start by saying this is awesome work. I have a couple of questions regarding formatting/linting (for reference I am using neovim with your sample configuration):

  1. Is it possible to configure the formatting command? With vim-go I was using goimports. As I am looking to fully migrate to bingo, can I do the same?
  2. Is it possible to configure how often the language-server tries to lint the code? Right now it is too often, which leads to constant errors (as soon as you type a key it will complain that letter is not defined) and lots of CPU usage. Instead I'd prefer to do it on events (like saving the buffer). This might be a question though to the language server plugin, not sure about that.
  3. Is it possible configure the linter used? I am using gometalinter with neomake today and I'd love to be able to do the same here.

Thanks!

Autocomplete unimported packages

One of the most needed feature which I missed from using vscode-go without lsp is being able to get autocompletion for unimported packages. Ideally typing fmt. should show autocompletion even if fmt package is not imported and after I select completion item it should add that import. Currently it is possible to get autoimport only if full expression is provided. For example I get import only if I write fmt.Print and hit save.

First letter is removed after selecting from autocomplete list

In vscode with new master bingo version after I select something from autocomplete it removes first letter.
Example: trigget autompletefor builtin

append(slice []T, elems ...T)

Hit enter to select it. Result:

ppend(slice []T, elems ...T)

The same issue occurs for package names and local variables.

This issue occurs because of https://github.com/saibing/bingo/blob/master/langserver/completion.go#L59

It's a simple fix:

insertText = insertText[len(prefix)-1:]

automatically compute module root directory

Currently if I set RootURI to file:///, bingo takes some time to scan all files in / and then gives this error:

LSP Error: / is out of GOPATH workspace [/home/fhs/go], but not a go module project

Doing the scan before showing the error is a separate issue. The reason that file:/// might be passed as RootURI is because many editors (e.g. vim, acme) don't have an "open folder" or "project directory" that would normally be used as the RootURI. Relying on LSP clients to set the correct RootURI requires them to have extra logic for each language, which goes against the goals of LSP. There is ongoing discussion here: golang/go#29174 and
https://groups.google.com/forum/#!topic/golang-tools/3f-GPF91B2c. In particular, this comment describes how LSP goals are violated: golang/go#29174 (comment).

I'm proposing that if RootURI is invalid, bingo should figure out the RootURI based on the first incoming requests. For example, if that request is a go-to-defenition request in file /a/b/foo/bar.go and there is a /a/b/go.mod file, bingo can search for the go.mod file and determine /a/b as the RootURI. If go.mod file is missing, it can fallback to checking $GOPATH.

The go tool already does something like that as far as I know, so I'm failing to understand why bingo doesn't do something similar.

[builtin package] Go v1.11.4 [LSP: Go compiler] illegal cycle in declaration of bool

I don't know I received this error recently from the builtin package.

I'm using latest Bingo version at this moment. My VScode settings is

    "go.languageServerExperimentalFeatures": {
        "format": true,
        "rename": true,
        "goToDefinition": true,
        "hover": true,
        "autoComplete": true,
        "signatureHelp": true,
        "goToTypeDefinition": true,
        "goToImplementation": true,
        "documentSymbols": true,
        "workspaceSymbols": true,
        "findReferences": true
    },

image

本地写的包不能补全

自己写的包不能提示补全,而且标准库的补全在我这里有的文件可以有的文件不可以。我搞不清楚发生了什么,有没有debug的方法?我会通过coc的debug测试一下。我用go-langserver是一切正常的
ulite

doesn't work while using cgo package

hi, my project used a cgo module "github.com/mattn/go-sqlite3", and bingo doesn't work at all when this module is imported.

package main

import (
	"fmt"

	"github.com/mattn/go-sqlite3"
)

func main() {
	sqlite3.  // nothing happened
}

And I noticed that if this module is imported, bingo costs about 1 minute to finish the package cache. I think it's abnormal.

My working directory is not in GOPATH.

Diagnostics keeps showing even if I delete the error line.

Thanks for your great work !

I use bingo in vim with LanguageClient-Neovim. And after I typed something wrong in a new line, the diagnostics shows in the gutter. But diagnotics keeps showing even if I fixed it or just delete the error line.

Bingo feedback

Hi @saibing,
I just tried bingo with vscode. It works great, fast and smooth. The only problem for me is that I'm using vscode workspaces and I have multi-root folders.

workspace
    frontend
    backend

In frontend I hold only UI related code, it's separate repo. But go lsp server doesn't allow to work in multi root. Do you know how complicated it would be to support workspaces?

High CPU usage

I am having high cpu usage most of the times.

This is my ps over a short time period:

UID   PID TTY       %CPU      TIME COMM
502 86392 ??       341.7 122:46.55 /Users/xxx/go/bin/bingo
502 86392 ??       449.7 122:54.86 /Users/xxx/go/bin/bingo
502 86392 ??       416.1 134:06.78 /Users/xxx/go/bin/bingo
502 86392 ??       260.9 154:58.74 /Users/xxx/go/bin/bingo
502 86392 ??       287.3 155:24.80 /Users/xxx/go/bin/bingo
502 86392 ??       317.6 156:10.78 /Users/xxx/go/bin/bingo
502 86392 ??       308.9 167:19.30 /Users/xxx/go/bin/bingo
502 86392 ??       415.5 174:50.48 /Users/xxx/go/bin/bingo
502 86392 ??       284.3 175:28.05 /Users/xxx/go/bin/bingo
502 86392 ??       565.1 192:56.58 /Users/xxx/go/bin/bingo

Using VS Code.
Let me know if there is anything else that can help debug this issue.

completion bug after defer

Completion seems to have a bug when typing after defer:

import (
	"fmt"
)

func main() {
	fmt.Println("hahah")
	defer fmt. // wrong completion item
}

format content bug

当我格式化文末内容时,如果按照 bingo 给出的提示, 会在末尾留一个空行, 这与gofmt期望的结果不符合;

Support for non-gomod projects?

Hi @saibing, is support for non-go module projects in the roadmap for bingo?

I'm currently working on a PR to add bingo & golsp to vscode-go, would also appreciate if you could take a look at it 😅

code formatting always changes vim buffer after saving.

After I save a go buffer with :w, the buffer is always modified by bingo's code formatting even if there is nothing changed.

This will make buffer in modified state all the time. You can't close the buffer by :q, only :wq works.

Misleading error from signatureHelp

When using Emacs with lsp-mode and hovering over non-call expressions, I am getting the following error:

Error from the Language Server: cannot find an enclosing function (Unknown error)

The error message points to here. And the reason for this error is lsp-mode by default also calls signatureHelp on hover.

Note that this behavior is not reproducible in vscode, because it does not call signatureHelp on hover. However it is not a client side misbehavior, according to lsp protocol:

Signature help represents the signature of something callable.
...
error: code and message set in case an exception happens during the signature help request.

given a cursor position that is not in any callable, the server should return null without error, meaning there is no signature at the point and nothing wrong with that, rather than return error saying no enclosing function. Returning null without error is also how sourcegraph/go-languageserver behaves.

保存文件时,有时候不能自动导入依赖

配置如下:

    "go.useLanguageServer": true,
    "go.alternateTools": {
        "go-langserver": "bingo"
    },
    "go.languageServerFlags": ["--trace", "--format-style", "goimports"],
    "go.languageServerExperimentalFeatures": {
        "format": true,
        "autoComplete": true
    },

go version: go1.11 darwin/amd64

在gopath之外的go mod项目

谢谢

On create new file, bingo server is crashed

Q

bingo server crashed on create a blank file.

Use IDE:

  • neovim 0.3.1
  • vscode 1.30.1

Crashed log

[Info  - 17:50:20] cached module demo.com/team/project package demo.com/team/project
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x10 pc=
0x141aae1]

goroutine 2303 [running]:
go/token.(*File).Name(...)
	/usr/local/Cellar/go/1.11.2/libexec/src/go/token/position.go:110
github.com/saibing/bingo/langserver/internal/cache.(*View).parse(0xc000122720, 0xc0130aa420, 0x58, 0x0, 0x0)
	/Users/marlonfan/Dev/code/go/bingo/langserver/internal/cache/view.go:92 +0x281
github.com/saibing/bingo/langserver/internal/cache.(*File).GetPackage(0xc0130996d0, 0x0, 0x0, 0x0)
	/Users/marlonfan/Dev/code/go/bingo/langserver/internal/cache/file.go:106 +0xc1
github.com/saibing/bingo/langserver.diagnostics(0x1604120, 0xc0130996d0, 0xc00004b900, 0x1590a10, 
0xc000465ef0)
	/Users/marlonfan/Dev/code/go/bingo/langserver/diagnostics.go:21 +0x4c
github.com/saibing/bingo/langserver.(*overlay).cacheAndDiagnoseFile.func1(
0xc0130996d0, 0xc0130aa420, 0x58, 0xc000122740, 0x1603ee0, 0xc0000260c0)
	
/Users/marlonfan/Dev/code/go/bingo/langserver/fs.go:124 +0x4c
created by github.com/saibing/bingo/langserver.(*overlay).cacheAndDiagnoseFile
	/Users/marlonfan/Dev/code/go/bingo/langserver/fs.go:123 +
0x110
[Error  - 17:50:20] Connection to server got closed. Server will not be restarted.
[Error  - 17:50:20] [object Object] exited with code: 2

To Reproduce

  1. create a new file, name is *.go, don't write nothing
  2. will get a server send crashed info

Excessive errors on hover

Hover produces an excessive amount of errors for types that bingo does not support (probably no need to support):

--> request #12: textDocument/hover: {"textDocument":{"uri":"file:///Users/lu/gocode/src/github.com/mailru/easyjson/gen/generator.go"},"position":{"line":14,"character":0}}
<-- error #12: textDocument/hover: {"code":0,"message":"invalid node: ast.File (1:1-533:2)","data":null}

--> request #13: textDocument/hover: {"textDocument":{"uri":"file:///Users/lu/gocode/src/github.com/mailru/easyjson/gen/generator.go"},"position":{"line":532,"character":0}}
<-- error #13: textDocument/hover: {"code":0,"message":"invalid node: ast.BlockStmt (518:68-533:2)","data":null}

--> request #14: textDocument/hover: {"textDocument":{"uri":"file:///Users/lu/gocode/src/github.com/mailru/easyjson/gen/generator.go"},"position":{"line":517,"character":4}}
<-- error #14: textDocument/hover: {"code":0,"message":"invalid node: ast.FuncDecl (518:1-533:2)","data":null}

This one can be reproduced with both vscode and Emacs, I will come up with a quick fix.

Readme clarification

Could you add in Readme example of using, also in part "install" need use "go build", but not "go install" - is it true work.

auto import used and remove unused packages

Hi, Thanks for the project

When using, I found that there is no support for auto import used and remove unused packages.

It should be a good feature when writing Go

I was wondering whether there is a plan for this?

if help needed, I can try to help to implement this.

cannot find module providing package

nvim --version

NVIM v0.3.2
Build type: Release
LuaJIT 2.0.5
Compilation: /usr/local/Homebrew/Library/Homebrew/shims/mac/super/clang -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -DNDEBUG -DMIN_LOG_LEVEL=3 -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wimplicit-fallthrough -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -D_GNU_SOURCE -DNVIM_MSGPACK_HAS_FLOAT32 -DNVIM_UNIBI_HAS_VAR_FROM -I/tmp/neovim-20181231-68781-192nq64/neovim-0.3.2/build/config -I/tmp/neovim-20181231-68781-192nq64/neovim-0.3.2/src -I/usr/local/include -I/usr/local/opt/gettext/include -I/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk/usr/include -I/tmp/neovim-20181231-68781-192nq64/neovim-0.3.2/build/src/nvim/auto -I/tmp/neovim-20181231-68781-192nq64/neovim-0.3.2/build/include
编译者 [email protected]

Features: +acl +iconv +jemalloc +tui
See ":help feature-compile"

     系统 vimrc 文件: "$VIM/sysinit.vim"
         $VIM 预设值: "/usr/local/Cellar/neovim/0.3.2/share/nvim"

Run :checkhealth for more info

go version

go1.12beta1

go version devel +e3b4b7baad Tue Dec 18 23:01:06 2018 +0000 darwin/amd64

go env

GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/nzlov/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/nzlov/workspace/go"
GOPROXY=""
GORACE=""
GOROOT="/Users/nzlov/program/go"
GOTMPDIR=""
GOTOOLDIR="/Users/nzlov/program/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/nzlov/workspace/yunss/free/ncp/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/1m/qhv1_zvx17j4c94k1bhr32gh0000gn/T/go-build375151526=/tmp/go-build -gno-record-gcc-switches -fno-common"

log

--> request #10: initialize: {"capabilities":{"textDocument":{"colorProvider":null,"completion":{"completionItem":{"snippetSupport":true}}},"workspace":{"applyEdit":true,"didChangeWatchedFiles":{"dynamicRegistration":true}}},"processId":82568,"rootPath":"/Users/nzlov/workspace/yunss/free/ncp","rootUri":"file:///Users/nzlov/workspace/yunss/free/ncp","trace":"off"}
Passing an initialize rootPath URI ("file:///Users/nzlov/workspace/yunss/free/ncp") is deprecated. Use rootUri instead.
<-- notif: window/showMessage: {"type":1,"message":"go [list -e -json -compiled -test=true -export=false -deps=true -find=false -- /Users/nzlov/workspace/yunss/free/ncp/...]: exit status 1: go: finding gogs.yunss.com/go/thirds latest\ngo: finding github.com/eknkc/amber latest\ngo: finding github.com/Shopify/goreferrer latest\ngo: finding github.com/kataras/golog latest\ngo: finding github.com/klauspost/compress/gzip latest\ngo: finding github.com/influxdata/platform/models latest\ngo: finding github.com/influxdata/platform latest\nbuild gogs.yunss.com/free/ncp/tools: cannot load gogs.yunss.com/go/thirds: cannot find module providing package gogs.yunss.com/go/thirds\n"}
<-- error #10: initialize: {"code":0,"message":"go [list -e -json -compiled -test=true -export=false -deps=true -find=false -- /Users/nzlov/workspace/yunss/free/ncp/...]: exit status 1: go: finding gogs.yunss.com/go/thirds latest\ngo: finding github.com/eknkc/amber latest\ngo: finding github.com/Shopify/goreferrer latest\ngo: finding github.com/kataras/golog latest\ngo: finding github.com/klauspost/compress/gzip latest\ngo: finding github.com/influxdata/platform/models latest\ngo: finding github.com/influxdata/platform latest\nbuild gogs.yunss.com/free/ncp/tools: cannot load gogs.yunss.com/go/thirds: cannot find module providing package gogs.yunss.com/go/thirds\n","data":null}

执行 go list -m -json all

{
	"Path": "gogs.yunss.com/go/thirds",
	"Version": "v0.0.0-20190105015651-edd1ccff261f",
	"Time": "2019-01-05T01:56:51Z",
	"Dir": "/Users/nzlov/workspace/go/pkg/mod/gogs.yunss.com/go/[email protected]",
	"GoMod": "/Users/nzlov/workspace/go/pkg/mod/cache/download/gogs.yunss.com/go/thirds/@v/v0.0.0-20190105015651-edd1ccff261f.mod"
}

not work for builtin function

Hi,

I don't know if it is really a bug. I cannot hover, or "go to definition" with builtin function.

I'm using the commit f2b7265.

没有补全提示

正常安装了。但是在编辑文件时并没有提示,使用coc是有效的,但是我切换LanguageClient-neovim并没有生效,使用go-langserver是正常的,如何debug它是否在工作?
最小init.vim

 let g:deoplete#enable_at_startup = 1
   
  set hidden
  let g:LanguageClient_rootMarkers = {
           \ 'go': ['.git', 'go.mod'],
           \ }
    
   let g:LanguageClient_serverCommands = {
       \ 'go': ['bingo', '--format-style', 'goimports'],
     \ }

collaborating on golsp

Hi @saibing! I'm one of the people currently working on golang.org/x/tools/cmd/golsp. We recently noticed and were excited to see your work on bingo. Our plan for golsp is for it to become the official language server supported by the Go team, and the folks at Sourcegraph have agreed that they would eventually like to use our code once it is ready.

We noticed that a lot of the code in this repository is shared with golsp and with go-langserver, so we were wondering if you would be interested in collaborating with us on golsp. More information about golsp can be found through the various channels listed here. If you'd like to continue this conversation, I'm happy to talk on this issue or via email ([email protected]).

Use vendor first if exists.

Some go.mod users prefer generating a vendor directory and keeping it in vcs for some networking reasons. Can we use vendor first if vendor directory exists?

I know it may be difficult if go/modules doesn't consider vendor directory when loading modules. But I know little about the new go/modules, is this possible?

unrecognized import path "golang.org/x/sys

HI, thanks your work.
网上的方法试过了, 手动下了,放在golangx.org/x/ , 但还是没解决。想问下该怎么解决?谢谢。

~/go/src/github.com/bingo$ GO111MODULE=on go install
go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/sys" (https fetch: Get https://golang.org/x/sys?go-get=1: dial tcp 64.233.162.81:443: i/o timeout)
go: golang.org/x/[email protected]: unrecognized import path "golang.org/x/net" (https fetch: Get https://golang.org/x/net?go-get=1: dial tcp 64.233.162.81:443: i/o timeout)
go: error loading module requirements

go version
go version go1.11.4 linux/386

no packages found for nested module

Hi! Thanks for great job!
I'm not sure, but I think your lsp server should handle configuration like this:

big_project
|
+- go.mod
|
`-subproject
    |
    `- go.mod

in second go.mod:

module github.com/someuser/big_project/subproject

replace github.com/someuser/big_project v0.1.0 => ../

because go build for subproject are fine and bingo:

no packages found for /Users/someuser/projects/big_project/subproject/cmd/main.go

PS. My client set project root to big_project directory

bingo gives up after it fails to open a file

If I set RootURI to file:///, initialization fails with this error:

initialize failed: jsonrpc2: code 0 message: open /.docker: permission denied
$ ls -ld /.docker
drwx------ 2 root root 4096 Feb 12  2015 /.docker

I do have a /.docker file that I can't access, but that doesn't mean bingo should give up. I'm not sure why it's trying to access /.docker, but there is no good way to set RootURI on traditional editors that don't have a "project directory". golang/go#29174 is possibly related.

multiple clients on tcp are not supported

I'll quote the spec:

The initialize request is sent as the first request from the client to the server. [...]
Until the server has responded to the initialize request with an InitializeResult, the client must not send any additional requests or notifications to the server.

Clearly initialization is per client. This makes sense because the initialziation is a way to tell the server the capabilities provided by the client.

If you have bingo listening on tcp for multiple clients, the first client initialization works but any clients after that will fail with this:

initialize failed: jsonrpc2: code 0 message: language server is already initialized

goto definition not working, `go list` error

--> request #1: textDocument/definition: {"textDocument":{"uri":"file:///Users/fannheyward/src/log-consumer/main.go"},"position":{"line":94,"character":15}}
<-- error #1: textDocument/definition: {"code":0,"message":"go [list -e -json -compiled -test=true -export=false -deps=true -find=false -- /Users/fannheyward/src/log-consumer]: exit status 1: go build github.com/jinzhu/configor: no Go files in \ngo build github.com/bsm/sarama-cluster: no Go files in \ngo build github.com/mailru/go-clickhouse: no Go files in \n","data":null}

Already set GO111MODULE=on, and manually exec go list -e -json -compiled -test=true -export=false -deps=true -find=false -- /Users/fannheyward/src/log-consumer, output is ok.

Readme clarification

Could you add in Readme example of using, also in part "install" need use "go build", but not "go install" - is it true work.

Go to definition not working inside stdlib

When I go to definition into sdtlib package and see how it works inside sometime I want to go deeper. But bingo says that this package not inside GOPATH and not contain go.mod. Is it possible to make go to definition inside stdlib useful?

illegal UTF-8 encoding

The file is encoded as UTF-8, but when using Chinese comments, it will prompt illegal UTF-8 encoding.

{
	"resource": "****",
	"owner": "_generated_diagnostic_collection_name_#0",
	"severity": 8,
	"message": "illegal UTF-8 encoding",
	"source": "LSP: Go compiler",
	"startLineNumber": 15,
	"startColumn": 20,
	"endLineNumber": 15,
	"endColumn": 20
}

Sending wrong active parameter in signatureHelp

Just built the project and trying it out with coc.nvim, for this simple code:

package main

func foo(a, b int) int {
	return 42
}

func main() {
	foo(
}

On foo(, I get wrong signatureHelp highlight, it highlights the last parameter foo(a int, *b int*), then when I insert the first integer, foo(4, , signatureHelp information returns the first parameter as active. I've checked the server communication.

Consume huge memory

Using f2b7265 with VS code and find bingo takes lots of memory by time.

After 30 mins of coding, it takes more than 3GB memory.
image

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.