codemirror-lang-ada
v0.1.1
Published
Ada language support for CodeMirror 6
Maintainers
Readme
codemirror-lang-ada
Ada language support for CodeMirror 6.
This is a community package that provides syntax highlighting, basic indentation, and folding for the Ada programming language.
Features
- Syntax highlighting for Ada 95/2005/2012 keywords, identifiers, numbers, strings, characters, attributes, operators, and comments.
- Case-insensitive keyword recognition.
- Line comment support (
--). - Basic indentation and folding.
Install
npm install codemirror-lang-adaUsage
import { EditorView, basicSetup } from "codemirror"
import { EditorState } from "@codemirror/state"
import { ada } from "codemirror-lang-ada"
const state = EditorState.create({
doc: `with Ada.Text_IO;
procedure Main is
begin
Ada.Text_IO.Put_Line ("Hello, World!");
end Main;`,
extensions: [basicSetup, ada()]
})
const view = new EditorView({
state,
parent: document.body
})Development
# Install dependencies
npm install
# Build the parser and bundle
npm run build
# Run tests
npm testThe parser is generated from src/ada.grammar using the @lezer/generator toolchain.
Contributing
Contributions are welcome! If you find a bug or want to improve Ada support, please open an issue or pull request on the GitHub repository.
