VS Code support for Vix++ files.
Vix++ is a thin language layer for Vix-powered C++ applications. It uses .vix files and adds simple use imports on top of standard C++.
use vix.core;
using namespace vix;
int main()
{
App app;
app.get("/", [](Request &, Response &res){
res.send("Hello, world");
});
app.run(8080);
return 0;
}This extension makes .vix files easier to write inside Visual Studio Code.
.vixfile recognition- Vix++ syntax highlighting
- C++-style editing support
- Vix++ snippets
- Run current
.vixfile - Build current
.vixfile - Check current
.vixfile - Basic diagnostics from
vix++ check
Without this extension, VS Code may treat .vix files like unknown text or try to analyze them as regular C++.
That can create false errors around Vix++ syntax such as:
use vix.core;This extension gives .vix files their own language id:
vixSo the editor can understand Vix++ syntax without confusing it with raw C++.
You need Vix++ installed and available in your terminal:
vix++ versionVix++ itself delegates builds to Vix, so vix should also be available:
vix --versionDefault commands used by the extension: vix++ and vix. You can change both paths in VS Code settings.
Open a .vix file, then use the Command Palette.
Vix++: Run Current FileVix++: Build Current FileVix++: Check Current File
Runs the current file:
vix++ run current-file.vixBuilds the current file:
vix++ build current-file.vixChecks the current file and reports diagnostics in VS Code:
vix++ check current-file.vixPath to the vix++ executable.
Default:
"vixpp.vixppPath": "vix++"Example:
"vixpp.vixppPath": "/usr/local/bin/vix++"Path to the vix executable used by vix++.
Default:
"vixpp.vixPath": "vix"Example:
"vixpp.vixPath": "/usr/local/bin/vix"Directory used by Vix++ for generated C++ files.
Default:
"vixpp.buildDir": ".vix/build/vixpp"Example:
"vixpp.buildDir": ".vix/generated"The extension includes snippets for common Vix++ patterns.
use vix.core;use std.iostream;
int main()
{
std::cout << "Hello from Vix++\n";
return 0;
}use vix.core;
using namespace vix;
int main()
{
App app;
app.get("/", [](Request &, Response &res){
res.send("Hello, world");
});
app.run(8080);
return 0;
}app.get("/", [](Request &, Response &res){
res.send("Hello, world");
});app.get("/api/hello", [](Request &, Response &res){
res.json({"message", "Hello from Vix++"});
});The extension highlights:
usedeclarationsvix,std, andlocalimport namespaces- C++ keywords
- strings, numbers, comments
- preprocessor directives
- Vix runtime symbols and common Vix functions
Example:
use vix.core;
use std.iostream;
use local.config;The command Vix++: Check Current File runs:
vix++ check file.vixIf Vix++ prints diagnostics like this:
main.vix:6:1: error: import declarations must appear before regular C++ code
hint: move this use declaration to the top of the fileThe extension shows them in the VS Code Problems panel.
Install dependencies:
npm installCompile:
npm run compileWatch mode:
npm run watchPackage the extension:
npm run packageThis generates a .vsix file.
vixpp-vscode/
├── package.json
├── tsconfig.json
├── language-configuration.json
├── syntaxes/
│ └── vix.tmLanguage.json
├── snippets/
│ └── vix.json
├── src/
│ └── extension.ts
├── icons/
│ └── vixpp.svg
├── README.md
├── LICENSE
├── .gitignore
└── .vscodeignoreThe goal is simple: .vix files should feel native in VS Code.
This extension does not replace the Vix++ CLI. It only improves the editor experience.
vix++ -> language frontend and CLI
vixpp-vscode -> editor integrationThis extension is experimental.
Current focus:
- syntax highlighting
- snippets
- run/build/check commands
- basic diagnostics
Future improvements may include:
- autocomplete for
useimports - hover documentation
- go to generated C++ file
- formatting
- full Vix++ language server
MIT License. See the LICENSE file for details.
Created by Gaspard Kirira
Source: [https://github.com/vixcpp/vixpp-vscode]