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: improve internal/lsp/cmd package #38085
Comments
Agree that it is hard to follow. I spent a long time staring at it for https://golang.org/cl/215742 -- and that CL simplified some things but made others more complicated. Also, feel free to send those reviews my way... Can we list what we'd want to change? Off the top of my head, the following things are complex or confusing:
Anything else come to mind? Some of these probably can't/shouldn't be fixed, for example I think executing commands over LSP is The Right Thing To Do. Also, it's probably too late to stop defaulting to the As a starting point, I think we can improve (2) and (3): it would help to lift handling of the cmdClient / jsonrpc2.Conn out of .Run and up to the application layer, instead injecting in the connection to the subcommand. That might also simplify the Another straightforward improvement is just to add a bunch more documentation around the tricky parts. WDYT? |
Yes, I think is too late for that.
Agree with this plan - for me (3) is the hardest to reason about. Thanks!
Definitely. Even just writing down how the tests work would help immensely. Another point of confusion to add to the list - we originally had a |
Oh, another that occurred to me (perhaps that can't be fixed) is the fact that options is a func(*source.Options). That frequently confuses me -- especially since source.Options is huge. |
Do you think it's reasonable to expect that workspace initialization will ever be cacheable enough to delete the |
I think the actual command line needs some thought.
I agree the internal hack should be vaporized, it ought to be possible (but maybe with a different cleaner hack added to the client server behavior) |
Closing this issue as no longer actionable. The command package has changed a bit, and while it's still not as clear as it could be, this issue does not track work that we plan to do. |
I am really struggling to do code reviews for the cmd package. The logical flow is hard to reason about, and the way to set options, etc. is not obvious. We should spend some time restructuring it to be more clear.
@findleyr, @heschik: If any suggestions/ideas immediately come to mind, please let me know.
The text was updated successfully, but these errors were encountered: