josa42 / coc-go

Go language server extension using gopls for coc.nvim.
MIT License
566 stars 30 forks source link

"[coc.nvim] definition not found" in subfolder but not in parent folder #217

Closed rpuntaie closed 11 months ago

rpuntaie commented 11 months ago

Example project were I observed this:

git clone --recursive https://github.com/cosmos/cosmos-sdk
cd cosmos-sdk
make

This works:

vim server/start.go
# search e.g. client.Context and with cursor on context: coc-definition

This does not work:

vim simapp/app.go
# search e.g. client.Context and with cursor on context: coc-definition

The error is:

[coc.nvim] definition not found

What is the reason, that the second does not work? Could it be that simapp is having a replace section in go.mod?

rpuntaie commented 11 months ago

I've realized that this is a gopls issue. It could be unable to handle a go.mod replace pointing to local folder (like https://github.com/golang/go/issues/40836). Or it could be related to multiple modules.