-
Notifications
You must be signed in to change notification settings - Fork 138
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
Conversation
f47e514
to
f2a5e49
Compare
@@ -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) |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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 🤷♂️
There was a problem hiding this comment.
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) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ah okay!
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. |
Closes #6