Skip to content

feat: add jac.toml syntax highlighting (jactoml language)#83

Merged
kugesan1105 merged 1 commit into
jaseci-labs:mainfrom
kugesan1105:feat/jactoml-highlighting
May 20, 2026
Merged

feat: add jac.toml syntax highlighting (jactoml language)#83
kugesan1105 merged 1 commit into
jaseci-labs:mainfrom
kugesan1105:feat/jactoml-highlighting

Conversation

@kugesan1105

@kugesan1105 kugesan1105 commented May 20, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds a dedicated jactoml language to the extension so every jac.toml project manifest in the Jaseci ecosystem (jaclang, jacBuilder, jac-scale, jac-byllm, jac-mcp, jac-super, jac-client, jaseci-package, docs, …) gets proper highlighting out of the box, with no dependency on another TOML extension.

  • New language jactoml registered with exact filename match on jac.toml (won't touch pyproject.toml, Cargo.toml, etc.).
  • A small Jac semantic layer:
    • Every table header [...] and [[...]] (any name, any dotted depth) is captured as one token under entity.name.tag.jac-known.jactoml, so the entire header renders in a single uniform color — no allowlist, no per-segment splitting ([dependencies.npm], [plugins.scale.sso.google], [[plugins.scale.microservices.shared_volumes]] all behave identically).
    • Incomplete [table headers (mid-edit) are tagged invalid.illegal.table.jactoml on the offending line only — no cascading color loss to lines below.
    • Shell-style env placeholders (${ECR_REGISTRY}, $HOST) inside any string flavor are scoped as variable.other.env.jactoml.
  • Language configuration (# comments, bracket pairs, autoclose, surround).
  • README updated to mention jac.toml support.

Bonus fix: Jac: Inspect Token Scopes was broken

Existing command threw ENOENT: .../vendor/onig.wasm on every published install because the wasm was never copied out of node_modules (which .vscodeignore excludes from the .vsix). Fixed by:

  • New copy-wasm npm script (run from both compile and package) that copies node_modules/vscode-oniguruma/release/onig.wasm into vendor/onig.wasm. vendor/ is gitignored, so the wasm is a build artifact, not a committed binary.
  • Inspector handler generalized to recognize both jac (.jac) and jactoml (jac.toml) languages, picking the correct grammar and scope automatically.
  • Clearer runtime error if the wasm is missing.

@kugesan1105
kugesan1105 force-pushed the feat/jactoml-highlighting branch 4 times, most recently from 501daf8 to e77c6a6 Compare May 20, 2026 12:37
Registers a new 'jactoml' language with exact-filename match on
'jac.toml' so every Jaseci project manifest gets proper highlighting
out of the box. Won't touch pyproject.toml, Cargo.toml, etc.

Grammar (syntaxes/jactoml.tmLanguage.json):
  - Every table header [...] and [[...]] at any dotted depth is
    captured as one whole-path token under
    entity.name.tag.jac-known.jactoml. No allowlist, no per-segment
    splitting: [dependencies.npm], [plugins.scale.sso.github],
    [[plugins.scale.microservices.shared_volumes]] all behave
    identically.
  - Incomplete '[table' lines (mid-edit) are tagged
    invalid.illegal.table.jactoml on the offending line only, so the
    color cascade that would otherwise hit every line below is
    prevented.
  - Shell-style env placeholders (${VAR} and bare $VAR) inside any
    string flavor (basic/literal x line/block) are scoped as
    variable.other.env.jactoml.

Language configuration (language-configuration.jactoml.json):
  - '#' line-comment toggling, bracket matching, autoclose, surround.

Bonus fix: 'Jac: Inspect Token Scopes' was broken
  - Existing command threw ENOENT on vendor/onig.wasm on every install
    because the wasm was never copied out of node_modules (which
    .vscodeignore excludes from the .vsix).
  - New copy-wasm npm script (run from both compile and package)
    copies the wasm into vendor/onig.wasm. vendor/ is gitignored,
    so it's a build artifact.
  - Inspector handler generalised to recognise both 'jac' and
    'jactoml' languages, picking the correct grammar/scope by
    languageId.

Test coverage:
  - 250 unit tests pass.
  - Covers: universal table capture, dotted paths, arrays-of-tables,
    arbitrary non-allowlisted names, ${VAR}/$VAR placeholders in
    every string flavor, incomplete-bracket recovery, multiline
    strings, dotted-key-vs-table trap, deep nesting, inline tables,
    datetime values, empty tables.
@kugesan1105
kugesan1105 force-pushed the feat/jactoml-highlighting branch from e77c6a6 to 5d85593 Compare May 20, 2026 12:40
@kugesan1105
kugesan1105 merged commit ff68160 into jaseci-labs:main May 20, 2026
2 checks passed
@kugesan1105
kugesan1105 deleted the feat/jactoml-highlighting branch May 20, 2026 13:02
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