Skip to content

Commit c3688c0

Browse files
committed
docs+ci: document diagnostics, bump to v0.2.0, harden CI
- README: Diagnostics section (severity mapping, .dtx exclusion note, settings table), retitled to 'Language Support' - CHANGELOG: 0.2.0 entry - package.json: version 0.2.0, @vscode/vsce as devDependency - ci.yml / release.yml: npm ci + tsc --noEmit + compile before packaging, so a type error or broken build fails the pipeline
1 parent 1f8294f commit c3688c0

6 files changed

Lines changed: 3881 additions & 25 deletions

File tree

.github/workflows/ci.yml

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,14 @@ jobs:
2020
- name: Validate grammar JSON
2121
run: node -e "JSON.parse(require('fs').readFileSync('syntaxes/expl3.tmLanguage.json','utf8')); console.log('grammar JSON ok')"
2222

23+
- name: Install dependencies
24+
run: npm ci
25+
26+
- name: Type-check
27+
run: npx tsc --noEmit
28+
29+
- name: Compile
30+
run: npm run compile
31+
2332
- name: Package (dry run)
24-
run: |
25-
npm install --no-save @vscode/vsce
26-
npx vsce package --no-yarn -o /tmp/expl3-vscode-ci.vsix
27-
npx vsce ls
33+
run: npx vsce package --no-yarn -o /tmp/expl3-vscode-ci.vsix

.github/workflows/release.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,8 +64,11 @@ jobs:
6464
fi
6565
echo "version check ok: $PKG_VER"
6666
67-
- name: Install tooling
68-
run: npm install --no-save @vscode/vsce
67+
- name: Install dependencies
68+
run: npm ci
69+
70+
- name: Type-check
71+
run: npx tsc --noEmit
6972

7073
- name: Package VSIX
7174
id: pack

CHANGELOG.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,21 @@
11
# Changelog
22

3+
## [0.2.0] - 2026-07-06
4+
5+
### Added
6+
7+
- **explcheck diagnostics.** Runs [`explcheck`](https://ctan.org/pkg/expltools)
8+
on expl3 files and reports issues as editor squiggles, mapped by severity
9+
(`e`/`t` → Error, `w` → Warning, `s` → Information) with precise ranges.
10+
- Triggers: on save (default), on type (debounced), or manual command.
11+
- Dirty buffers are linted via a temp file (explcheck reads no stdin).
12+
- Graceful one-time prompt when explcheck is missing; highlighting is
13+
unaffected.
14+
- `.dtx` / `.ins` excluded from linting (explcheck can't process them yet,
15+
see explcheck issue #20); highlighting still applies.
16+
- Settings: `expl3.check.{enable,path,run,debounce,maxLineLength,ignoredIssues,makeAtLetter}`.
17+
- Command: **expl3: Run explcheck on the active file**.
18+
319
## [0.1.0] - 2026-07-06
420

521
### Added

README.md

Lines changed: 42 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
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.
2124
Colors come from your active color theme — the extension only assigns scopes, so it
2225
looks 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

2663
This is an **injection grammar**: it layers on top of an existing LaTeX grammar rather

0 commit comments

Comments
 (0)