Add JSON syntax linting to CodeMirror v6 editor#3825
Add JSON syntax linting to CodeMirror v6 editor#3825Geethegreat wants to merge 1 commit intoprocessing:develop-codemirror-v6from
Conversation
|
🎉 Thanks for opening this pull request! Please check out our contributing guidelines if you haven't already. |
|
@Geethegreat Thanks for adding JSON linting — this definitely improves parity with JS/CSS Since we’re already on CodeMirror v6, we could potentially leverage @codemirror/lang-json’s syntax tree and surface diagnostics from error nodes instead. This would give more accurate ranges and a smoother typing experience, closer to what users expect from modern editors. @raclim WDYT? |
|
@Jatin24062005 Thanks for the feedback that’s a very fair point. Leveraging Curious to hear your thoughts, @raclim ready to adapt based on what the maintainers prefer here. |
|
hi all! I'll switch to the branch and check it out myself when I have a moment, but regarding the potential flickering issue, is it possible to see a screen recording of what it looks like for you? If flickering were an issue, I believe that we'd be seeing that in the other existing linters as well (js, css, html) so I suspect there's some sort of key debouncing built into codemirror to circumvent this issue anyways : ) I like the existing parse suggestion and don't think we need to over-engineer this, especially considering this codemirror thread where the creator suggests something quite similar to this solution here: I do think you could look into using the function mentioned there just to avoid duplicate code! Really appreciate the contribution and am excited about the momentum for v6! Thanks for all the great discussion : ) |
Fixes #3817
Changes:
Adds JSON syntax linting support to the CodeMirror v6 editor. The new linter parses JSON content and surfaces syntax errors at the correct character position.
I have verified that this pull request:
npm run lint)npm run test)npm run typecheck)developbranch.Fixes #123