A Visual Studio Code extension that provides syntax highlighting and language support for the Fault specification language.
-
Syntax Highlighting: Full syntax highlighting for Fault language constructs including:
- Keywords (
system,component,spec,assert,assume, etc.) - Types (
string,bool,int,float,natural,uncertain,unknown) - Constants (
nil,true,false,now) - Operators (assignment, logical, comparison, arithmetic)
- Comments (line and block)
- String literals (raw and interpreted)
- Numeric literals (decimal, hex, octal, float)
- Keywords (
-
Language Configuration:
- Comment toggling (Ctrl+/ for line comments, Shift+Alt+A for block comments)
- Bracket matching and auto-closing
- Auto-indentation
- Code folding
-
Linting and Error Detection:
- Real-time syntax validation with customizable rules
- Missing semicolon detection
- Invalid flow assignment detection (suggests using
->or<-) - Undefined variable warnings
- Type annotation suggestions
- Deprecated syntax warnings
- Configurable severity levels (error, warning, info, off)
- Debounced linting for better performance
- Install the extension from the VS Code Marketplace
- Open any
.fspecor.fsystemfile to see syntax highlighting in action
This extension automatically provides syntax highlighting and linting for files with the .fspec and .fsystem extensions.
The linter can be customized through VS Code settings. Access settings via File > Preferences > Settings and search for "fault-linter".
fault-linter.enabled: Enable/disable the linter (default: true)fault-linter.rules.missing-semicolon: Severity for missing semicolon rule (default: error)fault-linter.rules.invalid-flow-assignment: Severity for flow assignment rule (default: error)fault-linter.rules.undefined-variable: Severity for undefined variable rule (default: warning)fault-linter.rules.missing-type-annotation: Severity for type annotation rule (default: info)fault-linter.rules.deprecated-syntax: Severity for deprecated syntax rule (default: warning)fault-linter.debounceTime: Delay in milliseconds before linting after changes (default: 500)
- Fault: Refresh Linting - Manually refresh linting for all open Fault files
- Fault: Clear Diagnostics - Clear all linting diagnostics
To set up the development environment:
npm install
npm run compileTo package the extension:
npm install -g vsce
vsce packageContributions are welcome! Please feel free to submit issues and pull requests.
MIT License - see LICENSE file for details.