The VS Code Extension brings full editor support for the
CodeCharter DSL. When you write custom .ccr rules, you get
syntax highlighting, snippets, and auto-completion for schema properties.
Installation
- Get
codecharter-X.Y.Z.vsixfrom the portal downloads. - In VS Code: Command Palette → "Extensions: Install from VSIX..." → select the downloaded file.
Alternatively via CLI:
code --install-extension codecharter-X.Y.Z.vsix
The Windows installer does this
automatically when it finds code on the PATH.
Features
- Syntax highlighting for
.ccrfiles with a dedicated tokenizer. - Snippets for common rule skeletons.
- Auto-completion for schema properties (
TypeModel,MethodModel, and others) via an integrated language server. - Inline validation of rule syntax. Typos in property names or missing required headers are flagged immediately in the editor.
Commands in the Command Palette
CodeCharter: Validate current rule fileCodeCharter: Analyze workspace (.sln/.slnx/.csproj)CodeCharter: Restart language serverCodeCharter: Show language server output
Analyze workspace runs the CodeCharter CLI on the solution or project
in the VS Code terminal. Findings appear there as console output.
Configuration
Settings under codecharter.* in VS Code settings:
| Setting | Default | Description |
|---|---|---|
codecharter.serverPath |
empty | Path to the CodeCharter CLI. Empty = auto-detect from PATH. |
codecharter.trace.server |
off |
LSP tracing: off, messages, verbose. |
codecharter.analyze.rulesDirectory |
empty | Rules directory for Analyze workspace. Empty = ./rules in the workspace. |
Troubleshooting
If the language server does not start:
- Open the Output panel (
View → Output) and select CodeCharter in the dropdown. - Check the CLI path. If the CLI is not on the PATH, set
codecharter.serverPathexplicitly to the full path. - Check permissions on Linux and macOS. The binary must be executable
(
chmod +x codecharter).
More under VS Code Extension hangs.