A Visual Studio Code extension that provides syntax highlighting and linting for the NXC (Not eXactly C) language used with LEGO Mindstorms.
Extension ID: enrell.nxc-syntax
Marketplace: https://marketplace.visualstudio.com/items?itemName=enrell.nxc-syntax
Repository: https://github.com/enrell/nxc-syntax
- Syntax highlighting for
.nxcfiles - Code formatting with customizable indentation and style
- Real-time error detection with configurable diagnostics
- Auto-completion for functions and constants
- Hover information for functions
- Basic semantic analysis
- Unclosed braces and parentheses
- Unterminated strings
- Unused variables
- Undefined functions
- Lines too long
Install directly from the VS Code Marketplace by searching for "NXC Syntax" or by using the Extension ID shown above.
Alternatively, download the .vsix file from releases and install via Extensions > Install from VSIX.
Open any .nxc file in VS Code. The extension will:
- Apply syntax highlighting based on the TextMate grammar
- Provide diagnostics in the Problems panel for errors and warnings
- Offer completions and hover information where available
- Format your code using Shift+Alt+F or Ctrl+Shift+I
The extension includes a built-in code formatter that:
- Properly indents code blocks and control structures
- Formats operators with consistent spacing
- Aligns function parameters and arguments
- Handles preprocessor directives correctly
- Supports both spaces and tabs for indentation
Keyboard Shortcuts:
- Shift+Alt+F - Format entire document
- Ctrl+Shift+I - Format document (alternative)
- Right-click → "Format Document" in context menu
git clone https://github.com/enrell/nxc-syntax.git
cd nxc-syntax
bun install
bun run buildbun run dev # Development build
bun run build # Generate VSIX package
bun run test # Run testsThe extension provides the following configuration options:
{
"nxc.diagnostics.enabled": true,
"nxc.diagnostics.maxLineLength": 120,
"nxc.diagnostics.checkUnusedVariables": true,
"nxc.completion.suggestBuiltins": true,
"nxc.completion.parameterHints": true,
"nxc.formatting.indentSize": 4,
"nxc.formatting.useSpaces": true,
"nxc.formatting.formatOnSave": false
}- If diagnostics don't appear, verify that the file language is set to
NXC(bottom-right in VS Code). - Use the command NXC: Reparse Open Files after changing configuration or the grammar.
- Check the Output panel (select "NXC" or the extension host) for runtime logs.
- NXC: Format Document - Format the current NXC document
- NXC: Rebuild Index - Rebuild the symbol index
- NXC: Reparse Open Files - Reanalyze all open files
- NXC: Clear All Diagnostics - Clear all diagnostics
Please report issues and feature requests on the repository's issue tracker:
https://github.com/enrell/nxc-syntax/issues
Contributions are welcome — fork the repo, create a branch, and open a pull request.
This short checklist helps keep the extension healthy on the VS Code Marketplace:
- Keep
package.jsonfields accurate:name,version,publisher,engines.vscodeandicon. - Provide a clear
README.mdand a repository link. Keep README up to date with features and configuration. - Ship a valid license (
MITis present) and include an icon referenced bypackage.json. - Maintain a changelog or releases so users see activity when you publish new versions.
- Respond to issues and fix critical bugs quickly; Marketplace listings consider active maintenance.
- Avoid bundling sensitive secrets, and ensure the extension follows Marketplace policies.
If you want, I can also add a CHANGELOG.md, a release template, or a GitHub Actions workflow to automatically publish releases.
See the repository Releases page for the release history.