Skip to content

Commit de684aa

Browse files
authored
Merge pull request #12 from DKFuH/copilot/polish-vscode-syntax-highlighting
Polish VS Code syntax highlighting scopes
2 parents 2aa1b88 + 511fb69 commit de684aa

File tree

2 files changed

+26
-4
lines changed

2 files changed

+26
-4
lines changed

editors/vscode/README.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,17 @@ Current editor support for annotations:
7676
- `org-metric`
7777
- `org-event`
7878

79+
## Local Testing
80+
81+
To test the extension locally without publishing it:
82+
83+
1. Open the `editors/vscode` folder in VS Code.
84+
2. Press **F5** to launch the Extension Development Host (configured in `.vscode/launch.json`).
85+
3. In the new VS Code window, open any `.orgs` file from the repository `examples/` folder (one level up).
86+
4. Use **Developer: Inspect Editor Tokens and Scopes** (via the Command Palette) to verify that tokens receive the expected TextMate scopes.
87+
88+
Recommended test file: `../examples/lead-qualification.orgs` — it exercises the header, annotations, dotted references, operators, and conditional blocks together.
89+
7990
## Contributing
8091

8192
OrgScript is open-source. Join us on [GitHub](https://github.com/DKFuH/OrgScript) to contribute to the language spec or tooling.

editors/vscode/syntaxes/orgscript.tmLanguage.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -203,16 +203,27 @@
203203
"operators": {
204204
"patterns": [
205205
{
206-
"match": "(!=|<=|>=|->|=|<|>)",
207-
"name": "keyword.operator.orgscript"
206+
"match": "->",
207+
"name": "keyword.operator.arrow.orgscript"
208+
},
209+
{
210+
"match": "(!=|<=|>=|=|<|>)",
211+
"name": "keyword.operator.comparison.orgscript"
208212
}
209213
]
210214
},
211215
"references": {
212216
"patterns": [
213217
{
214-
"match": "\\b[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)+\\b",
215-
"name": "variable.other.property.orgscript"
218+
"match": "\\b([A-Za-z_][A-Za-z0-9_-]*)((?:\\.[A-Za-z_][A-Za-z0-9_-]*)+)\\b",
219+
"captures": {
220+
"1": {
221+
"name": "variable.other.object.orgscript"
222+
},
223+
"2": {
224+
"name": "variable.other.property.orgscript"
225+
}
226+
}
216227
}
217228
]
218229
}

0 commit comments

Comments
 (0)