1- # expl3 (LaTeX3) Syntax Highlighting
1+ # expl3 (LaTeX3) Language Support
22
3- Syntax highlighting for ** expl3** (the LaTeX3 programming layer) in Visual Studio Code.
3+ Syntax highlighting ** and** static-analysis diagnostics for ** expl3** (the
4+ LaTeX3 programming layer) in Visual Studio Code.
45
5- Files full of expl3 code — ` xeCJK.dtx ` , ` expl3.dtx ` , your own ` .sty ` /` .cls ` — normally
6- render as a wall of undifferentiated ` \command ` text. This extension adds a semantic
7- layer on top so the pieces that actually carry meaning stand out.
6+ Files full of expl3 code — ` xeCJK.dtx ` , ` expl3.dtx ` , your own ` .sty ` /` .cls ` —
7+ normally render as a wall of undifferentiated ` \command ` text. This extension
8+ adds a semantic highlighting layer so the pieces that carry meaning stand out,
9+ and surfaces [ ` explcheck ` ] ( https://ctan.org/pkg/expltools ) lint results directly
10+ in the editor.
811
912![ expl3 highlighting before / after] ( https://raw.githubusercontent.com/CTeX-org/expl3-vscode/main/images/before-after.png )
1013
@@ -21,6 +24,40 @@ layer on top so the pieces that actually carry meaning stand out.
2124Colors come from your active color theme — the extension only assigns scopes, so it
2225looks native in Dark+, Light+, Solarized, and everything else.
2326
27+ ## Diagnostics (explcheck)
28+
29+ If [ ` explcheck ` ] ( https://ctan.org/pkg/expltools ) is available, the extension runs it
30+ on your expl3 files and shows the results as squiggles, mapped by severity:
31+
32+ | explcheck prefix | meaning | VS Code severity |
33+ | ------------------| ---------| ------------------|
34+ | ` e ` , ` t ` | errors / type errors | Error |
35+ | ` w ` | warnings | Warning |
36+ | ` s ` | style warnings | Information |
37+
38+ ` explcheck ` ships with TeX Live's ` expltools ` package (` tlmgr install expltools ` ). If
39+ it is not found, the extension prompts once and stays quiet otherwise — highlighting
40+ keeps working regardless.
41+
42+ > ** ` .dtx ` / ` .ins ` are not linted.** ` explcheck ` cannot process bundled sources
43+ > directly yet (see [ explcheck issue #20 ] ( https://github.com/witiko/expltools/issues/20 ) ,
44+ > planned for v1.1); unpack them to ` .sty ` /` .tex ` first. Highlighting still applies to
45+ > ` .dtx ` .
46+
47+ ### Settings
48+
49+ | Setting | Default | Description |
50+ | ---------| ---------| -------------|
51+ | ` expl3.check.enable ` | ` true ` | Enable explcheck diagnostics. |
52+ | ` expl3.check.path ` | ` explcheck ` | Path to the executable. |
53+ | ` expl3.check.run ` | ` onSave ` | ` onSave ` , ` onType ` (debounced), or ` manual ` . |
54+ | ` expl3.check.debounce ` | ` 400 ` | Debounce (ms) for ` onType ` . |
55+ | ` expl3.check.maxLineLength ` | ` 0 ` | Max line length before S103 (0 = explcheck default 80). |
56+ | ` expl3.check.ignoredIssues ` | ` [] ` | Issue ids/prefixes to suppress, e.g. ` ["s103"] ` . |
57+ | ` expl3.check.makeAtLetter ` | ` false ` | Tokenize ` @ ` as a letter (like ` .sty ` files). |
58+
59+ Command ** expl3: Run explcheck on the active file** triggers a check on demand.
60+
2461## Requirements
2562
2663This is an ** injection grammar** : it layers on top of an existing LaTeX grammar rather
0 commit comments