Description
Today there is a module reference cycle between x/tools and x/text,
which we'd ideally like to remove to make it easier to tag modules.
x/text depends on x/tools for x/tools/go/loader.
That should probably be updated to use go/packages, but so be it.
It's a fairly reasonable use of x/tools either way.
x/tools depends on x/text only for x/tools/internal/lsp/source,
which uses golang.org/x/text/unicode/runenames in Hover.
The reference cycle would “naturally” go away if we move some of the internals around
so that internal/lsp can move to gopls/internal/lsp.
There are very few uses of internal/lsp outside gopls, and what's there is fairly generic
and would make sense outside of internal/lsp.
So it looks like this would work:
internal/lsp/diff -> internal/diff (used in go/analysis/analysistest)
internal/lsp/fuzzy -> internal/fuzzy (used in internal/analysisinternal)
internal/lsp/debug/tag -> internal/event/tag (used in internal/jsonrpc2)
internal/lsp -> gopls/internal/lsp
At that point the x/text reference would be entirely under gopls.
That feels cleaner anyway, and also a step toward making it possible to move gopls to x/gopls at some point.
It's a pretty straightforward change, especially since package boundaries and package names are not changing.
I'm happy to send the CLs.
Is there any gotcha here that I'm missing?