Skip to content

Polish VS Code syntax highlighting scopes#12

Merged
DKFuH merged 3 commits intomainfrom
copilot/polish-vscode-syntax-highlighting
Apr 1, 2026
Merged

Polish VS Code syntax highlighting scopes#12
DKFuH merged 3 commits intomainfrom
copilot/polish-vscode-syntax-highlighting

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 1, 2026

The initial TextMate grammar lumped the transition arrow and comparison operators into a single scope, and highlighted dotted references as a monolithic token — making it hard for themes to apply meaningful colour distinctions.

Grammar (syntaxes/orgscript.tmLanguage.json)

  • Operators split by semantics:

    • ->keyword.operator.arrow.orgscript (state transition arrow, not a comparator)
    • =, !=, <, <=, >, >=keyword.operator.comparison.orgscript
  • Dotted references split into object + property:

    • leadvariable.other.object.orgscript
    • .statusvariable.other.property.orgscript

    Before: lead.status was a single variable.other.property token.
    After: object and property halves are independently scopeable by themes.

{
  "match": "\\b([A-Za-z_][A-Za-z0-9_-]*)((?:\\.[A-Za-z_][A-Za-z0-9_-]*)+)\\b",
  "captures": {
    "1": { "name": "variable.other.object.orgscript" },
    "2": { "name": "variable.other.property.orgscript" }
  }
}

Docs (editors/vscode/README.md)

Added a Local Testing section: F5 → Extension Development Host, then use Developer: Inspect Editor Tokens and Scopes to verify scopes. Points to examples/lead-qualification.orgs as the canonical test file.

Copilot AI linked an issue Apr 1, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Improve VS Code syntax highlighting for OrgScript files Polish VS Code syntax highlighting scopes Apr 1, 2026
Copilot AI requested a review from DKFuH April 1, 2026 08:49
Copilot finished work on behalf of DKFuH April 1, 2026 08:49
@DKFuH DKFuH marked this pull request as ready for review April 1, 2026 08:54
Copy link
Copy Markdown
Owner

@DKFuH DKFuH left a comment

Choose a reason for hiding this comment

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

Looks good overall.\n\nNotes\n- Thanks for splitting the operator scopes (arrow vs comparison) and the dotted reference captures.\n- I added a tiny doc tweak so local testing points to the correct examples path when the workspace is editors/vscode.\n\nNo blocking issues.

@DKFuH DKFuH merged commit de684aa into main Apr 1, 2026
4 checks passed
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.

Polish VS Code syntax highlighting scopes

2 participants