UniFFI UDL Syntax Highlighting
A Visual Studio Code extension for UniFFI Definition Language (.udl) files.
The grammar follows the UniFFI UDL guide and uses the existing uniffi-dl JetBrains plugin in this repository as a reference for keywords, literals, comments, and punctuation.
Features
- Associates
.udl files with the udl language id.
- Provides TextMate syntax highlighting for:
- UniFFI/WebIDL declarations such as
namespace, dictionary, interface, enum, callback, and typedef.
- Built-in scalar, container, string, buffer, and promise types.
- Extended attributes such as
[Throws=...], [Error], [Enum], [Trait], [WithForeign], [ByRef], and [Name=...].
- Line comments, block comments, strings, numbers, nullable types, and punctuation.
- Adds bracket pairing, auto-closing pairs, comment toggling, folding markers, and common UDL snippets.
Development
Open this folder in VS Code and press F5 to launch an Extension Development Host.
npm test
The test script validates the extension manifest and JSON contribution files.
Example
namespace sprites {
Point translate([ByRef] Point position, Vector direction);
};
dictionary Point {
double x;
double y;
};
[Error]
enum SpriteError {
"OutOfBounds",
};
References
| |