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

Expose server version via LSP #318

Merged
merged 1 commit into from
Nov 24, 2020
Merged

Expose server version via LSP #318

merged 1 commit into from
Nov 24, 2020

Conversation

radeksimko
Copy link
Member

Closes #6

@radeksimko radeksimko added the enhancement New feature or request label Nov 23, 2020
@radeksimko radeksimko requested a review from a team November 23, 2020 12:16
@@ -166,6 +166,11 @@ func (svc *service) Assigner() (jrpc2.Assigner, error) {
ctx = lsctx.WithRootModuleManager(ctx, svc.modMgr)
ctx = lsctx.WithRootModuleLoader(ctx, rmLoader)

version, ok := lsctx.LanguageServerVersion(svc.srvCtx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't get the cycle here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is because the server starts with its own empty context, for better or worse:
https://github.com/creachadair/jrpc2/blob/3fb8081ec1bde4adba1b3a57dff458328a8ea769/server.go#L304

You could argue both sides - it's good for isolation - you don't get to inherit things by accident, but also it can make it more verbose 🤷‍♂️

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah okay!

@@ -166,6 +166,11 @@ func (svc *service) Assigner() (jrpc2.Assigner, error) {
ctx = lsctx.WithRootModuleManager(ctx, svc.modMgr)
ctx = lsctx.WithRootModuleLoader(ctx, rmLoader)

version, ok := lsctx.LanguageServerVersion(svc.srvCtx)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ah okay!

@radeksimko radeksimko merged commit ecd4286 into main Nov 24, 2020
@radeksimko radeksimko deleted the f-lsp-server-version branch November 24, 2020 08:07
@ghost
Copy link

ghost commented Dec 24, 2020

I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the context necessary to investigate further.

@ghost ghost locked as resolved and limited conversation to collaborators Dec 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add ServerInfo identification of the LS
2 participants