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

Unable to use go-langserver #70

Closed
robertgzr opened this issue Sep 8, 2018 · 5 comments
Closed

Unable to use go-langserver #70

robertgzr opened this issue Sep 8, 2018 · 5 comments
Labels
help wanted Extra attention is needed

Comments

@robertgzr
Copy link

Describe the bug
Configuring to use go-langserver leads to errors at startup

To Reproduce
coc-settings.json:

{

  "coc.source.gocode.enable": false,

  "languageserver": {
    
    "go-langserver": {
      "command": "go-langserver",
      "args": ["-gocodecompletion", "-func-snippet-enabled"],
      "filetypes": ["go"],
      "enable": true
    },
 
  }
}

Additional context
go-langserver logs

langserver-go: reading on stdin, writing on stdout
Passing an initialize rootPath URI ("file:///home/robertgzr/code-1/src") is deprecated. Use rootUri instead.
jsonrpc2 handler: notification "workspace/didChangeConfiguration" handling error: jsonrpc2: code -32601 message: method not supported: workspace/didChangeConfiguration
[3  - 16:59:49] Request textDocument/completion failed.
  Message: invalid position: /home/robertgzr/code-1/src/main.go:1:1 (file only has 2 lines)
  Code: 0 
@chemzqm chemzqm added the help wanted Extra attention is needed label Sep 8, 2018
@chemzqm
Copy link
Member

chemzqm commented Sep 8, 2018

I can fix the notification problem but I still get

2018-09-09T03:58:37.610 ERROR (pid:6249) [server] - uncaughtException Error: Header must provide a Content-Length property.
    at StreamMessageReader.onData (/Users/chemzqm/vim-dev/coc.nvim/node_modules/vscode-jsonrpc/lib/messageReader.js:200:27)
    at Socket.<anonymous> (/Users/chemzqm/vim-dev/coc.nvim/node_modules/vscode-jsonrpc/lib/messageReader.js:185:19)
    at Socket.emit (events.js:182:13)
    at addChunk (_stream_readable.js:283:12)
    at readableAddChunk (_stream_readable.js:264:11)
    at Socket.Readable.push (_stream_readable.js:219:10)

Have no idea with it.

@chemzqm
Copy link
Member

chemzqm commented Sep 8, 2018

Should be bug of sourcegraph/go-langserver#313

Try build from the source to see if error still exists, it would be better to configure go-langserver like this

    "go": {
      "command": "go-langserver",
      "args": [],
      "initializationOptions": {
        "funcSnippetEnabled": true,
        "gocodeCompletionEnabled": true
      },
      "filetypes": ["go"]
    },

@fannheyward
Copy link
Member

sourcegraph/go-langserver@d0a69e9 has fixed this error.

@chemzqm
Copy link
Member

chemzqm commented Sep 10, 2018

When I use gocode 1.11 the gocode of go-langserver get panic, see sourcegraph/go-langserver#316

It's not panic with gocode 1.10 but I still can't get any correct completion in every situation. I think that go-langserver suck at it.

The solution is not to use completion of go-langserver or help them to fix the problem.

@chemzqm chemzqm closed this as completed Sep 10, 2018
@chemzqm
Copy link
Member

chemzqm commented Oct 1, 2018

It works as expected on my mac now, try update go-langserver.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

3 participants