Skip to content

✨ Add JSONC language support for comment parsing and traceability#70

Merged
ubmarco merged 3 commits into
useblocks:mainfrom
floroks:feat/add_jsonc_support
Jun 20, 2026
Merged

✨ Add JSONC language support for comment parsing and traceability#70
ubmarco merged 3 commits into
useblocks:mainfrom
floroks:feat/add_jsonc_support

Conversation

@floroks

@floroks floroks commented May 31, 2026

Copy link
Copy Markdown
Contributor

Adds jsonc language support, also checks .json files if they start with a comment (see jsonc.org).

Florian Roks <florian.roks@mercedes-benz.com>, Mercedes-Benz Tech Innovation GmbH
Provider Information

@floroks floroks marked this pull request as ready for review June 1, 2026 09:26
@floroks

floroks commented Jun 1, 2026

Copy link
Copy Markdown
Contributor Author

comment type is intentionally jsonc, to allow future extensions for json with definition of fields to use

@floroks floroks force-pushed the feat/add_jsonc_support branch from 5b9845e to 16895cc Compare June 1, 2026 09:30
@floroks floroks force-pushed the feat/add_jsonc_support branch from 16895cc to f1fa8a0 Compare June 18, 2026 07:04
@floroks

floroks commented Jun 18, 2026

Copy link
Copy Markdown
Contributor Author

rebased the PR, previous test failures from the approved workflow don't seem to be related to the PR

@ubmarco ubmarco force-pushed the feat/add_jsonc_support branch from f1fa8a0 to 23c7fac Compare June 19, 2026 10:54
@ubmarco ubmarco self-requested a review June 19, 2026 10:57
floroks and others added 2 commits June 19, 2026 17:48
Adds jsonc language support, also checks .json files if they start with a comment (see jsonc.org).

Signed-off-by: Florian Roks <florian.roks@mercedes-benz.com>
The JSONC row added the continuation cells one space too deep and
re-indented the existing Go row the same way, so both rows' cells sat
at column 6 under a `* -` whose first cell is at column 5. docutils no
longer saw a uniform two-level bullet list, failing the directive:

  configuration.rst: ERROR: Error parsing content block for the
  "list-table" directive: two-level bullet list expected, but row 7
  does not contain a second-level bullet list.

Under `sphinx-build -nW` (the `docs` CI job) this broke the build.
Dedent both rows' cells to column 5, matching every other row.
@ubmarco ubmarco force-pushed the feat/add_jsonc_support branch from dbee348 to f90c593 Compare June 19, 2026 15:48
SCOPE_NODE_TYPES is read only by find_next_scope / find_enclosing_scope,
which are reached for cpp/python/cs/rust/go. YAML and JSONC return early
from find_associated_scope into their own find_*_associated_structure
finders (data formats associate a comment with the surrounding pair /
item / scalar, not an enclosing or following declaration), so their dict
entries were never read.

Remove them and document why they are absent. The JSONC entry only
hosted the IMPL_JSONC_2 traceability marker, so move that marker onto
find_jsonc_associated_structure, which is the actual implementation it
describes. No behaviour change; YAML/JSONC association tests unaffected.

@ubmarco ubmarco left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR & the efforts you put in!
Added some things, good to merge now.

@ubmarco ubmarco requested a review from bburda June 20, 2026 18:55
@ubmarco ubmarco merged commit dcb1ac9 into useblocks:main Jun 20, 2026
12 checks passed
@ubmarco ubmarco mentioned this pull request Jun 20, 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.

3 participants