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

Language server broken on go1.23 #222

Open
hexcowboy opened this issue Sep 11, 2024 · 3 comments
Open

Language server broken on go1.23 #222

hexcowboy opened this issue Sep 11, 2024 · 3 comments

Comments

@hexcowboy
Copy link

This morning my go language server stopped working, though all other CoC plugins remain working.

When I do actions like jump to definition or show cursor, it just says "[coc.nvim] hover not found" or similar.

Currently installed: [email protected],

:CocInfo

## versions

vim version: NVIM v0.9.5
node version: v18.19.1
coc.nvim version: 0.0.82-9c25f2f7 2024-08-31 14:53:59 +0800
coc.nvim directory: /Users/jack/.local/share/nvim/site/pack/packer/start/coc.nvim
term: Apple_Terminal
platform: darwin

## Log of coc.nvim

2024-09-11T12:45:02.780 INFO (pid:48996) [plugin] - coc.nvim initialized with node: v18.19.1 after 364
2024-09-11T12:45:02.804 INFO (pid:48996) [services] - LanguageClient gopls state change: stopped => starting
2024-09-11T12:45:02.889 INFO (pid:48996) [services] - LanguageClient gopls state change: starting => running
2024-09-11T12:45:02.891 INFO (pid:48996) [services] - service go started
2024-09-11T12:45:06.259 INFO (pid:48996) [attach] - receive notification: jumpDefinition []
2024-09-11T12:45:37.088 INFO (pid:48996) [attach] - receive notification: doHover []

:checkhealth

coc: health#coc#check

- OK nvim version satisfied
- OK Environment check passed
- WARNING pyx command not work, some extensions may fail to work, checkout ":help |pythonx|"
- WARNING Install pynvim by command: `pip install pynvim --upgrade`
- OK Javascript bundle build/index.js found
- OK Service started
@hexcowboy
Copy link
Author

hexcowboy commented Sep 11, 2024

Also I'm using go1.23.0 darwin/arm64 and golang.org/x/tools/gopls v0.16.2 which may be the issue.

Edit: I changed go 1.23 and toolchain go1.23.0 to go 1.22 and toolchain go1.22.0 and coc-go began working again, though I'm not sure what the underlying issue is

@hexcowboy hexcowboy changed the title Language server broken Language server broken on go1.23 Sep 11, 2024
@hexcowboy
Copy link
Author

For anyone else needing help here, you can use gopls directly in coc by changing your ~/.config/nvim/coc-settings.json like so:

{
  ...other config here
  "languageserver": {
    "go": {
      "command": "gopls",
      "filetypes": ["go"]
    }
  }
}

@pendar747
Copy link

I'm also having an issue with coc-go not working in projects that use go 1.23

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

No branches or pull requests

3 participants
@pendar747 @hexcowboy and others