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

x/tools/gopls: "pattern too long" error with gopls@master + k8s + coc.nvim #59635

Closed
findleyr opened this issue Apr 14, 2023 · 5 comments
Closed
Assignees
Labels
gopls/incremental gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@findleyr
Copy link
Contributor

Noticed that when using gopls@master in kubernetes, I am starting to get a new exception in coc.nvim:

image

I believe this is related to the (enormous) file watching pattern we serve for Kubernetes directories. But it is surprising that I don't get this error with gopls@v0.11.0. Needs investigation.

More generally, I really hope we can switch to simply requesting all file watching notifications, and avoid the enormous pattern entirely. But this must be carefully tested in various LSP clients.

@findleyr findleyr added NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. gopls/incremental labels Apr 14, 2023
@findleyr findleyr added this to the gopls/v0.12.0 milestone Apr 14, 2023
@gopherbot gopherbot added Tools This label describes issues relating to any tools in the x/tools repository. gopls Issues related to the Go language server, gopls. labels Apr 14, 2023
@hyangah
Copy link
Contributor

hyangah commented Apr 14, 2023

can we have an experimental flag to use a simplified file watching patterns instead and let people test (in particular those involved in the issue that resulted in the current way of file watch registration)?

@findleyr findleyr self-assigned this Apr 17, 2023
@findleyr findleyr added the okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 label Apr 24, 2023
@findleyr
Copy link
Contributor Author

So, it turns out that we do get this error with gopls@v0.11.0, so I have moved this to 'okay-after-beta1'.

Here is the upstream discussion about file watching: microsoft/vscode#109754

In that discussion, it is suggested that we could simply watch **. I think we should test this in various LSP clients to confirm it works.

If we do so, I don't think we need to guard it behind a flag. Or if we do, the default should be to use the simplified watching logic and we can can have a temporary flag to revert to the old behavior.

@findleyr
Copy link
Contributor Author

findleyr commented May 3, 2023

Unfortunately I don't think this is going to get prioritized for v0.12.0, as much as I'd like to fix it.

@findleyr
Copy link
Contributor Author

Note, so that I don't forget: we could write a conformance test for LSP clients:

  1. set up a test repo.
  2. write a program that performs certain file operations on disk.
  3. configure clients to start gopls with -debug=... and -logfile=...
  4. pass the debug server and logfile location to the program from step 2
  5. have the program tail the gopls logs and query gopls state via the debug server, to assert that disk operations were processed correctly

@gopherbot
Copy link

Change https://go.dev/cl/496835 mentions this issue: gopls: add a new "subdirWatchPatterns" setting

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
gopls/incremental gopls Issues related to the Go language server, gopls. NeedsInvestigation Someone must examine and confirm this is a valid issue and not a duplicate of an existing one. okay-after-beta1 Used by release team to mark a release-blocker issue as okay to resolve either before or after beta1 Tools This label describes issues relating to any tools in the x/tools repository.
Projects
None yet
Development

No branches or pull requests

4 participants