Editors
The VS Code extension gives .brm files highlighting, types, style support and the diagnostics of the compiler. Other editors can use the same language server and TypeScript plugin.
VS Code
The extension is in packages/vscode. It gives:
- Highlighting for markup, blocks, scripts, expressions and styles.
- Types, completion, hover and go to definition from TypeScript, in
.brmfiles and in.tsfiles that import them. - Completion, hover and errors in style blocks, for CSS, SCSS and Less.
- The errors and warnings of the compiler, such as a compile-time function that is not imported, a value that is changed in place, or an image without
alt.
It bundles a language server for styles and diagnostics, and a TypeScript plugin for types. It needs no native modules, so it works on every platform.
Other editors
- Run
brumate-language-server --stdiofrom@brumate/language-serverwith the language server client of the editor. It gives style features and the diagnostics of the compiler. - For types, add
@brumate/typescript-pluginto the TypeScript server of the editor, as TypeScript describes. - The TextMate grammar is in
packages/vscode/syntaxes. Its scope name issource.brm.
Limits
- TypeScript 7 does not load plugins, so types in
.brmfiles need TypeScript 5.0 to 6. VS Code ships with a version that works. - The diagnostics of the compiler read one file at a time. A warning that depends on how other files use a component can differ from the build, which reads the whole project.