-
-
Notifications
You must be signed in to change notification settings - Fork 15
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
Fix client capability for semantic tokens #27
Conversation
@markdumay Thanks for contributing! |
Great, good to hear you approve the proposed change. I made a small documentation change and submitted a force push. It seems this has triggered the CircleCI workflows. There is now an error though:
It looks like the |
@markdumay sorry for late, I'll comment later, maybe ~6h. |
@markdumay Unfortunately, the gojay bindings are written by my hand. Could you patch the below diff? It should work. diff --git a/capabilities_client_gojay.go b/capabilities_client_gojay.go
index 3c2be32..759d87a 100644
--- a/capabilities_client_gojay.go
+++ b/capabilities_client_gojay.go
@@ -1821,7 +1821,7 @@ var (
// MarshalJSONObject implements gojay.MarshalerJSONObject.
func (v *SemanticTokensWorkspaceClientCapabilitiesRequests) MarshalJSONObject(enc *gojay.Encoder) {
enc.BoolKeyOmitEmpty(keyRange, v.Range)
- enc.BoolKeyOmitEmpty(keyFull, v.Full)
+ enc.AddInterfaceKey(keyFull, v.Full)
}
// IsNil implements gojay.MarshalerJSONObject.
@@ -1833,7 +1833,7 @@ func (v *SemanticTokensWorkspaceClientCapabilitiesRequests) UnmarshalJSONObject(
case keyRange:
return dec.Bool(&v.Range)
case keyFull:
- return dec.Bool(&v.Full)
+ return dec.Interface(&v.Full)
}
return nil
} |
Thanks @zchee, I force pushed the changes. CircleCI now indicates I'm not authorized to run the workflows though. |
Codecov Report
@@ Coverage Diff @@
## main #27 +/- ##
=====================================
Coverage 60.5% 60.5%
=====================================
Files 40 40
Lines 5538 5538
=====================================
Hits 3356 3356
Misses 2143 2143
Partials 39 39
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
@markdumay merged. Thanks contribute! |
@markdumay also released a new tag. https://github.com/go-language-server/protocol/releases/tag/v0.11.2 |
Great, glad to help. Keep up the good work! |
First of all, great to see you guys are making the effort to port the LSP specification to Go. I started experimenting with your package quite recently. I encountered a small problem when trying to unmarshal the
InitializeParams
as generated byvscode-languageclient
with version7.0.0
. VSCode generates the client capabilities automatically, but handling the payload ofInitializeParams
on the server side (written in Go using your protocol package) gives the following error:It seems the following section of the
InitializeParams
JSON is the cause of the issue.According to the official specification, the value for
full
can be eitherboolean
or another embedded struct.This PR fixes the issue by adjusting the struct
SemanticTokensWorkspaceClientCapabilitiesRequests
incapabilities_client.go
. It simply changes the type ofFull
frombool
tointerface{}
. Let me know if you need more evidence or supporting files to reproduce the error.