Skip to content

Wrap LSPAny over JToken with structural equality, add ref to STJ#74

Open
razzmatazz wants to merge 4 commits into
ionide:mainfrom
razzmatazz:wrap-lsp-any
Open

Wrap LSPAny over JToken with structural equality, add ref to STJ#74
razzmatazz wants to merge 4 commits into
ionide:mainfrom
razzmatazz:wrap-lsp-any

Conversation

@razzmatazz
Copy link
Copy Markdown
Contributor

@razzmatazz razzmatazz commented Jun 5, 2026

Preparation for #73. This PR can be treated as RFC, as well.

LSPAny was a bare JToken alias — JObject/JArray have a broken GetHashCode and JsonElement (the intended future backing type) provides neither equality nor hashing. This PR introduces a thin wrapper with Equals/GetHashCode via JToken.DeepEquals and a LSPAnyConverter for transparent serialization, and updates serialize/deserialize to produce/consume LSPAny directly.

The wrapper also exposes fromJToken / fromJsonElement factory members and a JsonElement property (bridged via raw JSON text for now), backed by a new System.Text.Json 10.0.8 package reference (which includes a netstandard2.0 target). This makes LSPAny the single migration seam: swapping the internal backing from JToken to JsonElement will only touch the inside of this type.

…quality

This is to enable mechanical conversion of the codebase to support System.Text.Json by replacing JToken with
JsonElement.
@razzmatazz razzmatazz changed the title Update LSPAny type to wrap NJL.JToken and provide structural equality, update serialize/deserialize to work with LSPAny Wrap LSPAny over JToken with structural equality Jun 5, 2026
@razzmatazz razzmatazz changed the title Wrap LSPAny over JToken with structural equality Wrap LSPAny over JToken with structural equality, add ref to STJ Jun 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant