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/internal/lsp: Reuse code for other language server #34404

Closed
slrtbtfs opened this issue Sep 19, 2019 · 2 comments
Closed

x/tools/internal/lsp: Reuse code for other language server #34404

slrtbtfs opened this issue Sep 19, 2019 · 2 comments
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. Tools This label describes issues relating to any tools in the x/tools repository.
Milestone

Comments

@slrtbtfs
Copy link

Hi,

I'm currently working on building a language server for PromQL written in golang.
I plan to reuse large parts of the gopls code for that.

Because most of the code resides in go/tools/internal I will probably have to copy everything to another repo.

Another issue is that gopls is currently designed in a way that the language agnostic code imports the language specific code.

At the same time I'd like to sync my own code base with the one of gopls as much as possible and be also able to contribute my changes back upstream if appropriate.

Are there any Ideas of what would be the best way to handle this?

@gopherbot gopherbot added this to the Unreleased milestone Sep 19, 2019
@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 Sep 19, 2019
@stamblerre
Copy link
Contributor

stamblerre commented Sep 19, 2019

What specific packages are you interested in? I imagine you would mostly be interested in the protocol and jsonrpc2 packages?

We're definitely considering making them public at some point (see #31080), but they are still very much in flux, which is why we haven't yet. I think I would suggest vendoring those packages for now, and then at some point you will be able to import them directly. If you have changes you're interested in making, feel free to send them our way (though it's worth noting that the protocol package is generated code).

@golang golang deleted a comment from gopherbot Sep 19, 2019
@ianthehat
Copy link

Happy to work with you on this, but as Rebecca said be warned that we are going to be making major changes to many of the packages you might be interested in. jsonrpc2 is probably fairly stable, protocol is not because we need to change it to improve the cancellation behaviour, and the stuff above that is all in flux. We may well make some/all of the packages public in the future, for now they are in internal specifically because we need to be able to make breaking changes all the time.

There are some changes planned that will help in the future as well, as we need to support other "languages" in gopls (go.mod files need to be their own language for instance, as do go template files), and we would happily upstream changes that help you extract only the bits you need as they will probably tend towards cleaner overall architecture if done right anyway.

There are multiple other people "vendoring" some of the packages for other uses, we are fine with that.

Github issues are probably not the easiest mechanism to talk, feel free to reach out to us by email, or in slack or whichever mechanism you would like to talk some more, we can also video conference if you want to discuss something.

Going to close this issue as it is not really an issue we can take action on, but please do reach out to us to talk some more.

@golang golang locked and limited conversation to collaborators Sep 18, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
FrozenDueToAge gopls Issues related to the Go language server, gopls. 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