Skip to content

Conversation

datho7561
Copy link
Contributor

What does this PR do?

This PR updates vscode-json-languageservice to the latest version.

The primary motivation for doing this is to allow warnings to be reported on schemas. I would like to report warnings on schemas as a part of #1065.

When updating the json language service, there were many API changes that I needed to adapt to, and some tests that I changed.

Notably, I needed to copy a lot of the implementation of JSONSchemaService into our subclass of JSONSchemaService. JSONSchemaService turns all schema identifiers into URIs and escapes all / in the fragment, and does this in the private normalizeId method that we can't override Combined, these behaviours cause many tests to fail.

What issues does this PR fix or reference?

Closes #1069

Is it tested? How?

Existing test suite.

@coveralls
Copy link

Coverage Status

coverage: 83.316% (-0.6%) from 83.871%
when pulling 0b6b08d on datho7561:update-vscode-json-languageservice
into de78c0e on redhat-developer:main.

@msivasubramaniaan msivasubramaniaan self-requested a review June 23, 2025 18:42
@datho7561 datho7561 marked this pull request as draft June 26, 2025 21:06
@datho7561
Copy link
Contributor Author

~200 tests are failing when I rebase this PR. This is broken; I need to take another proper look at this.

@brian-mulier-p
Copy link

Hello! We need this bump for our project, is it something any idea on when you're going to have another look at it? I already tried a bump PR on my end before seeing yours but I didn't dig enough into the code to fix the remaining bits for it to work properly..

@datho7561
Copy link
Contributor Author

I'll do a quick rebase on this PR; there's a lot broken though. We overwrite vscode-json-languageservice internals, and those internals have changed. It's been pretty painful to figure out why certain cases are failing.

I'm starting to think that copying the code we need over might make more sense than trying to rewrite the functionality we need by subclassing an internal class. I don't think we're saving any effort by reusing vscode-json-languageservice, since we need to modify the code extensively and using vscode-json-languageservice makes the code inflexible.

The primary motivation for doing this is to allow warnings to be
reported on schemas.
I would like to report warnings on schemas as a part of
redhat-developer#1065.

When updating the json language service,
there were many API changes that I needed to adapt to,
and some tests that I changed.

Notably, I needed to copy a lot of the implementation of
`JSONSchemaService` into our subclass of `JSONSchemaService`.
`JSONSchemaService` turns all schema identifiers into URIs and escapes all
`/` in the fragment,
and does this in the private `normalizeId` method that we can't override
Combined, these behaviours cause many tests to fail.

Closes redhat-developer#1069

Signed-off-by: David Thompson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Update vscode-json-languageservice to latest version
4 participants