The expandWorkspaceToModule setting affects the way gopls behaves in surprising ways, and at best works around limitations that can better be addressed otherwise. The word 'workspace' in this setting is ill defined:
Does it mean the root of the go command? If so, we should ignore this setting and always choose the best root.
Does it mean the directory outside of which to exclude diagnostics / analysis? If so, the setting name is confusing, and anyway it is simpler to always analyze open files (as we do anyway), and always show compiler errors for the entire workspace.
Is it a memory optimization? If so, we should endeavor to base this memory optimization on open files, rather than open directories.
In general, I would not expect the user to know how to use this setting. For that reason alone, we should remove it.
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
Dec 29, 2022
The
expandWorkspaceToModule
setting affects the way gopls behaves in surprising ways, and at best works around limitations that can better be addressed otherwise. The word 'workspace' in this setting is ill defined:In general, I would not expect the user to know how to use this setting. For that reason alone, we should remove it.
CC @adonovan
The text was updated successfully, but these errors were encountered: