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 (
comline generation) - Clean β remove generated code (
comline generation clean)
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 four 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"
}Run the language server on the host system:
{
"comline.server.mode": "host"
}Inside a Flatpak (below) this goes through flatpak-spawn --host; anywhere else
the editor is already on the host, and host is the same as path. Set
comline.server.customPath as well to run a binary that isn't on the host's
PATH, such as ~/.cargo/bin/comline-lsp (written out, ~ is not expanded).
path and custom look up the program where the editor runs. path searches
the editor's own PATH (with PATHEXT on Windows) and says which directories it
searched if the server isn't there. An editor started from a launcher or a
dock can have a different PATH than your shell.
The bundled server needs none of this: it is a static build and runs inside the
sandbox. Read on only to run a different comline-lsp (a newer build, say), or
the comline CLI, in the Flatpak builds of VSCodium (com.vscodium.codium) or
VS Code (com.visualstudio.code).
The editor runs in a sandbox with its own PATH and its own runtime, so it
can't run programs installed on your system. Install the program on the host as
usual, and the extension runs it there with
flatpak-spawn --host:
pathmode does this by itself inside a Flatpak. For the CLI it is the default, so Build/Check/Generate/Clean work withcomlineinstalled on the host. For the server, set"comline.server.mode": "path"(or"host").- If the program isn't on the host's
PATH(the host command runs with your session'sPATH, which can lack~/.cargo/bin), set"host"mode andcustomPathto its absolute path on the host. The extension checks the host first and tells you what to install or which setting to change. - It needs
flatpak-spawnin the sandbox and the permission to talk toorg.freedesktop.Flatpakon D-Bus, which the Flathub manifests of both editors grant (VSCodium, VS Code:--talk-name=org.freedesktop.Flatpak).flatpak info --show-permissions <app-id>lists what yours has;flatpak override --user --talk-name=org.freedesktop.Flatpak <app-id>adds it back. - The server's stdio is passed through, and
RUST_LOG(thecomline.server.debugsetting) is forwarded with--env.
A custom path (custom mode) is read inside the sandbox. Both Flathub
manifests have --filesystem=host, so the binary can be anywhere under your home
directory (or another path host covers), but not in the host's /usr, /etc,
/bin or /lib: those are reserved
paths,
a --filesystem for them has no effect, and the host's /usr is at
/run/host/usr, not /usr. A server installed in /usr/bin can only be
reached with host mode. A binary the sandbox can read must also run there: it
has the Flatpak runtime's libraries, not your distro's, so a dynamically linked
build may not start (the bundled Linux servers are static musl builds for that
reason). host mode has neither limit.
After changing a setting, run Developer: Reload Window; the extension reads the
server settings when it activates.
{
// Enable debug logging
"comline.server.debug": true,
// Trace LSP communication (off, messages, verbose)
"comline.trace.server": "messages"
}comline.warnOnCoreMismatch (default true): the language server and the CLI
each know which comline-core they were built with (comline-lsp --version,
comline --version). When they differ, the extension warns once per session
that diagnostics may differ from what comline generation reports. Nothing is
said if either one doesn't report it. "Don't show again" in the warning, or
this setting set to false, turns it off.
The Build/Check/Generate/Clean commands look for comline on PATH by
default (comline.cli.mode: path; inside a Flatpak, on the host, see
Flatpak). To use a non-PATH install instead:
{
"comline.cli.mode": "custom",
"comline.cli.customPath": "/path/to/comline"
}"host" runs it on the host system, as for the server above, with
comline.cli.customPath as the program when set.
Generate runs comline generation and Clean runs comline generation clean,
so the CLI has to be a version with those commands (cli#153); older ones had
generate and clean.
- 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. The error message lists the directories searched; an editor started from a launcher can have a differentPATHthan your shell - Custom mode: Check that
comline.server.customPathpoints to the correct binary - Host mode: the program has to be on the host (see the message the extension shows)
- Flatpak: see Flatpak
- 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>
# Type-check (tsc; also builds out/ for the unit tests)
yarn compile
# Bundle the extension into dist/extension.js (what the editor runs)
yarn bundle
# 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.