Norsa
Norsa language support for Visual Studio Code.
Build from Git
Requires Node.js and npm. Clone the repository, install the locked dependencies, and package the extension:
git clone https://codeberg.org/sadikahasan6/norsa.git
cd norsa/extension/vsc-ext
npm ci
npm run build
This creates norsa-0.0.1.vsix in this directory. To install it in VS Code, run:
npm run install:code
For VSCodium, use npm run install:codium instead.
- Syntax highlighting, snippets, and file icons for
.nsn files.
- Utility-class completions and CSS details in
.nsn and HTML files.
- Tailwind CSS IntelliSense support for
.nsn files when the Tailwind CSS IntelliSense extension is installed.
- Hover descriptions for Norsa directives, components, and HTML elements.
- Typing
< suggests components found under src/ as <Component /> (excluding page.nsn, layout.nsn, and pages/).
- Prettier formatting for
.nsn files via the bundled plugin (see below).
The extension bundles Prettier and its Norsa parser plugin. .nsn files format with Format Document and Format on Save without extra setup. The formatter uses the project's Prettier configuration when present, and otherwise follows the editor's tab width and spaces/tabs setting.
For command-line Prettier in a project, copy prettier-plugin-norsa.js into that project, install Prettier (npm install --save-dev prettier), and configure the plugin:
{
"plugins": ["./prettier-plugin-norsa.js"],
"overrides": [{ "files": "*.nsn", "options": { "parser": "norsa" } }]
}
Tag names are protected: <norsa:head>, <slot />, and component casing (<Button>, <Table>) are preserved.