You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Please help confirm if it is a purely Textmate grammar issue:
12
+
1. set `"commonLisp.StaticAnalysis.enabled": false` in this extension's built-in settings (under `Common Lisp` tab) or set `"editor.semanticHighlighting.enabled": false` in VS Code's settings.
13
+
2. reload VS Code.
14
+
3. check if you still see the bug and describe your findings.
15
+
16
+
- VS Code Version: *You can find it by*[*how-do-i-find-the-version*](https://code.visualstudio.com/docs/supporting/FAQ#_how-do-i-find-the-version)
17
+
- Desktop Electron Version or Browser version: *You can find it by*[*how-do-i-find-the-version*](https://code.visualstudio.com/docs/supporting/FAQ#_how-do-i-find-the-version)
18
+
- OS Version: *which OS and its version*
19
+
20
+
**Describe the bug**
21
+
A clear and concise description of what the bug is.
22
+
23
+
**Code**
24
+
```lsp
25
+
;; Please include a code snippet that demonstrates the issue
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+10-1Lines changed: 10 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -109,7 +109,8 @@ Run `find ./src -name '*.ts' | xargs wc -l` to check the physical lines of code
109
109
## Declarative Language Features
110
110
111
111
### Syntax Highlight
112
-
We have two syntax files in `./syntaxes`, and we use `./scripts/build_grammar.mjs` to convert them into `json` format:
112
+
#### Introduction
113
+
We have two syntax files in `./syntaxes`, and we use `./syntaxes/scripts/build_grammar.mjs` to convert them into `json` format:
113
114
-`commonlisp.yaml` is the main syntax of Common Lisp.
114
115
-`cl_codeblock.yaml` is the [injection grammar](https://code.visualstudio.com/api/language-extensions/syntax-highlight-guide#injection-grammars) for Markdown.
115
116
@@ -121,13 +122,21 @@ If you need to modify the syntax, here are some helpful materials:
Mastering the TextMate grammars is very difficult. If you are a beginner, you can try to start with a small work sample and then work on it incrementally.
125
127
The recommended workflow is:
126
128
1.`git add`
127
129
2. construct a regex and verify the regex in [regex101](https://regex101.com/)
128
130
3. add the regex to the syntax
129
131
4. convert the syntax into `json` and test the syntax in real world
130
132
133
+
#### Maintain grammar health
134
+
1. After you modified the grammar, run `npm run bg` to rebuild the grammar.
135
+
2. Then, run `npm run testg` to test the grammar with the fixtures in `syntaxes/test/baselines`.
136
+
> You may optionally run `npx tsc -p syntaxes/scripts/tsconfig.json` to generate `gen_record.mjs`.
137
+
3. Check if it is the test result you expected. Run `npm run diff` to find the differences between the baselines and generated.
138
+
4. If the changes are what you expect, run `npm run accept` to accept the new baselines.
139
+
131
140
### Snippet
132
141
In `./snippets`.
133
142
See [Snippet Guide](https://code.visualstudio.com/api/language-extensions/snippet-guide) and [creating-your-own-snippets](https://code.visualstudio.com/docs/editor/userdefinedsnippets#_creating-your-own-snippets).
0 commit comments