OMG IDL (AstuteDDS)
Syntax highlighting, snippets, and language tooling for OMG IDL 4.2 — the
Interface Definition Language used by the Object Management Group's Data
Distribution Service (DDS) standard, as implemented by
AstuteDDS.
Features
- Syntax highlighting for
.idl files: keywords, builtin types (long,
octet, sequence<T>, string<N>, ...), @annotation(...) syntax (@key,
@appendable, @mutable, @id, ...), scoped names (Module::Type),
comments (//, /* */, /** */ doc comments), and literals.
- Snippets for common declarations:
module, struct (appendable/final/
mutable), @key fields, union/switch, enum, typedef, sequence,
and interface.
- Editor conveniences: bracket matching, auto-closing pairs, comment
toggling, and code folding.
- Generate Code from IDL...: right-click a
.idl file (Explorer or
editor) to run the astutedds-idl compiler and generate C++/C/Python code.
Only shown when the compiler is detected on idl.compilerPath.
- Format Document: re-indents based on brace nesting (honours the
editor's tab size/spaces setting), trims trailing whitespace, collapses
redundant inter-token spacing (e.g. alignment-padded declarations like
long id;) down to a single space, joins a declaration that's been
split across multiple lines (e.g. struct\nName\n{) back onto one line so
opening braces end up placed consistently, and drops blank lines nested
inside braces (blank lines between top-level declarations are kept).
Comment bodies and string/char literal contents are always left alone.
Works standalone (no compiler required). Set this extension as the default
formatter for .idl files (done automatically) and enable
"editor.formatOnSave": true for [omg-idl] to format on save.
This extension is set as the default formatter for .idl files automatically.
Add the following to your user or workspace settings.json to also format on
save:
"[omg-idl]": {
"editor.formatOnSave": true
}
Note: block comment bodies (the lines inside /* ... */) are left untouched
to preserve doc-comment alignment, so their indentation may not perfectly line
up if the enclosing declaration's indent level changes.
Requirements
None for syntax highlighting, snippets, and editor conveniences — these work
standalone. The optional diagnostics and language-server features shell out to
native binaries (see settings below).
Extension Settings
| Setting |
Default |
Description |
idl.compilerPath |
astutedds-idl |
Path to the AstuteDDS IDL compiler executable, used by idl.enableDiagnostics. |
idl.enableDiagnostics |
false |
Run the compiler on save/open to report syntax errors as Problems. Superseded by idl.enableLanguageServer. |
idl.enableLanguageServer |
false |
Enable astutedds-idl-lsp for hover, go-to-definition, outline, and diagnostics. |
idl.languageServerPath |
"" |
Path to the astutedds-idl-lsp binary. Empty = use the bundled platform binary, or astutedds-idl-lsp on PATH. |
Building the language server (server/)
The language server reuses the lexer/parser from
astutedds-cxx's IDL
compiler, vendored as static source copies at server/vendor/idl_compiler/
(see VENDORED_FROM.md for the
exact upstream commit and update instructions).
cmake -B server/build -S server -DCMAKE_BUILD_TYPE=Release
cmake --build server/build --parallel
This produces server/build/astutedds-idl-lsp. Set idl.languageServerPath
to that path (or copy it to server-bin/<platform>/ before packaging, which
npx vsce package --target <platform> will bundle automatically) and enable
idl.enableLanguageServer.
License
MIT — see LICENSE.
| |