Skip to content

Standard TextMate scope names; migrate workspace color rules (4.3.10) - #1233

Merged
ddehilster merged 1 commit into
VisualText:masterfrom
ddehilster:fix/107-standard-scopes
Oct 13, 2026
Merged

ddehilster merged 1 commit into
VisualText:masterfrom
ddehilster:fix/107-standard-scopes

Conversation

@ddehilster

Copy link
Copy Markdown
Member

Bumps grammars/ to VisualText/nlpplus-tmbundle#3, which renames every
invented scope to its TextMate-convention equivalent (keyword.constants
-> constant.language, keyword.attribute -> entity.other.attribute-name,
literal.* -> meta.literal.*, string.double -> string.quoted.double, the
dictionary's comment/keyword/function borrowings, kbb concept levels,
copied suffixes). Tokens are unchanged; only names differ -- checked
over 16.3M tokens in 3,372 real files.

colorizeAnalyzer() has been copying textMateRules keyed to the old
names into every analyzer workspace. src/language/scopeMigration.ts
maps each old name to every new name it used to cover (comment.line.dict
was the dict headword and the .kb/.kbb/.tree comment) and rewrites
those rules once, so existing colors are preserved exactly. The shipped
templates were regenerated through the same function. Dry run over the
16 analyzer workspaces on this machine: all parse, all migrate.

langTest checks the map against the grammars themselves: no old name
survives unless it maps to itself, every new name exists.

Closes #107.

Merge order

  1. fix: standard TextMate scope names in every grammar nlpplus-tmbundle#3 first, with a merge commit (this pins its branch commit ab0b138, which stays reachable from main only if not squashed).
  2. Then this PR.

🤖 Generated with Claude Code

Bumps grammars/ to VisualText/nlpplus-tmbundle#3, which renames every
invented scope to its TextMate-convention equivalent (keyword.constants
-> constant.language, keyword.attribute -> entity.other.attribute-name,
literal.* -> meta.literal.*, string.double -> string.quoted.double, the
dictionary's comment/keyword/function borrowings, kbb concept levels,
copied suffixes). Tokens are unchanged; only names differ -- checked
over 16.3M tokens in 3,372 real files.

colorizeAnalyzer() has been copying textMateRules keyed to the old
names into every analyzer workspace. src/language/scopeMigration.ts
maps each old name to every new name it used to cover (comment.line.dict
was the dict headword and the .kb/.kbb/.tree comment) and rewrites
those rules once, so existing colors are preserved exactly. The shipped
templates were regenerated through the same function. Dry run over the
16 analyzer workspaces on this machine: all parse, all migrate.

langTest checks the map against the grammars themselves: no old name
survives unless it maps to itself, every new name exists.

Closes VisualText#107.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ddehilster
ddehilster merged commit 2c56e50 into VisualText:master Oct 13, 2026
5 checks passed
@ddehilster
ddehilster deleted the fix/107-standard-scopes branch October 13, 2026 18:29
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.

Change custom color names to color names

1 participant