Language support for Comline schema files (.ids).
This extension provides rich language support for Comline through integration with the Comline Language Server:
- Keywords:
struct,enum,protocol,const,use,import,namespace,option - Primitive types:
i8-i128,u8-u128,f32,f64,bool,string,bytes - Collection types:
list,map,set,option - Comments: single-line (
//) and multi-line (/* */) - String literals and escape sequences
- Numbers: integers, floats, hexadecimal
- Real-time Diagnostics - Syntax error detection as you type
- Document Symbols - Hierarchical outline view (Ctrl/Cmd+Shift+O)
- Hover Information - Type definitions and signatures on hover
- Go to Definition - Jump to type declarations (F12)
- Find References - Locate all usages of a symbol (Shift+F12)
- Auto-Completion - Context-aware suggestions for keywords, types, and symbols
- Semantic Tokens - Enhanced syntax highlighting based on semantic analysis
- Comment toggling (
Ctrl/Cmd+/) - Bracket matching and auto-closing
- Code folding for struct/enum/protocol blocks
comline.tomlhighlighting, and diagnostics, completion, hover and quick fixes from the Comline language server, which reads the file against the package next to it: the languagesconfig.idpdeclares, the encodings in view, and the versions its generators handle. Other TOML extensions such as Even Better TOML attach to thetomllanguage, so they leavecomline.toml(its owncomline-tomllanguage) alone
A Comline icon in the editor title bar (when a .ids/.idp file or comline.toml is open)
opens a menu to run the comline CLI
against the current workspace, with a toast reporting success or failure:
- Build β compile and freeze a new version
- Check β validate without writing anything
- Generate β write generated code for every configured target
- Clean β remove generated code
Each is also available from the Command Palette as Comline: Build /
Comline: Check / Comline: Generate / Comline: Clean. Requires the
comline CLI to be installed and on PATH (or configured via
comline.cli.customPath, see below) β install it with:
cargo install --git https://github.com/ComlineProject/cli- The language server is bundled. Releases ship one package per platform
(
linux-x64,linux-arm64,darwin-x64,darwin-arm64,win32-x64), each carrying its owncomline-lsp. Editing features need nothing else. - Build / Check / Generate / Clean need the
comlineCLI, which is not bundled. Install it and put it onPATH, or pointcomline.cli.customPathat it (see CLI Binary Location):cargo install --git https://github.com/ComlineProject/cli
Search for "Comline" in the Extensions view. The editor picks the package for your platform.
- Download the
.vsixfor your platform from releases, e.g.comline-vscode-0.1.0-linux-x64.vsix.SHA256SUMSlists their checksums. - In VS Code:
Extensionsβ...βInstall from VSIX... - Select the downloaded file
On a platform without its own package, install the -universal one. It has no
bundled server, so set comline.server.mode to path or custom (below).
Every change to main is built as a GitHub prerelease (v0.1.1-dev.N), and
release candidates appear as -rc.N prereleases. Neither is published to Open
VSX: install them from releases the same way. Expect them to be less tested.
Not published there yet; use a .vsix from releases.
The extension supports three modes for locating the language server binary:
The extension includes a pre-built language server binary. No configuration needed!
Use a globally installed comline-lsp binary:
{
"comline.server.mode": "path"
}First, install the language server:
cargo install --git https://github.com/ComlineProject/language-serverSpecify a custom path to the language server binary:
{
"comline.server.mode": "custom",
"comline.server.customPath": "/path/to/comline-lsp"
}{
// Enable debug logging
"comline.server.debug": true,
// Trace LSP communication (off, messages, verbose)
"comline.trace.server": "messages"
}The Build/Check/Generate/Clean commands look for comline on PATH by
default. To use a non-PATH install instead:
{
"comline.cli.mode": "custom",
"comline.cli.customPath": "/path/to/comline"
}- Open any
.idsfile - The extension will automatically activate and start the language server
- Enjoy intelligent code editing features!
/// User service protocol
struct User {
id: u64
name: string
email: string
created_at: u64
}
enum UserRole {
Admin
User
Guest
}
error UserNotFound {
message = "no user with id {self.id}"
id: u64
}
protocol UserService {
function get_user(id: u64) -> User ! UserNotFound;
function create_user(name: string, email: string) -> User;
function delete_user(id: u64) -> bool;
}
- Default mode: Ensure the bundled binary is included with the extension
- PATH mode: Run
which comline-lsp(Linux/Mac) orwhere comline-lsp(Windows) to verify installation - Custom mode: Check that
comline.server.customPathpoints to the correct binary
- Ensure the file has a
.idsextension - Try reloading the window:
Ctrl/Cmd+Shift+PβDeveloper: Reload Window
- Check the Output panel:
ViewβOutputβ Select "Comline Language Server" - Enable trace logging:
"comline.trace.server": "verbose" - Restart the language server:
Ctrl/Cmd+Shift+PβComline: Restart Language Server
# Clone the repository
git clone https://github.com/ComlineProject/comline-vscode
cd comline-vscode
# Install dependencies
yarn install
# Link a local comline-lsp build (needed to actually run the server β
# see TESTING.md)
yarn link-binary <path-to-a-language-server-checkout>
# Compile TypeScript
yarn compile
# Package the extension
yarn packageThis creates a .vsix file that can be installed manually.
Contributions are welcome! Please open issues or submit pull requests on GitHub.
MIT License - see LICENSE for details.