No description
Find a file
2024-02-18 12:41:17 +01:00
src specialization and highlight fixes 2024-02-18 12:24:32 +01:00
.gitignore start working on grammar 2024-02-13 22:20:51 +01:00
.npmignore start working on grammar 2024-02-13 22:20:51 +01:00
LICENSE add license 2024-02-18 12:41:01 +01:00
package.json update name and version 2024-02-18 12:41:12 +01:00
README.md update readme 2024-02-18 12:41:17 +01:00
test.js specialization and highlight fixes 2024-02-18 12:24:32 +01:00

SurrealQL lezer and codemirror 6 support

This packages provides a lezer parser as well as CM6 language support for SurrealQL. Parser may not be complete as the documentation for SurrealQL is incomplete, but it should be good enough for general code highlight.

Also note that not all statements are supported yet, SELECT was the one I focused on the most.

Installation

npm install lezer-lang-surrealql

Usage

There are no options for the parser (for now), and both ES imports and CommonJS require are supported. Typescript is also supported.

// ES import
import { surrealql } from 'lezer-lang-surrealql';

// CommonJS require
const { surrealql } = require('lezer-lang-surrealql');

// you can then use it as an extension in codemirror

const editor = new EditorView({
    state: EditorState.create({
        doc: '',
        extensions: [
            basicSetup,
            surrealql(),
        ],
    }),
    parent
});
function surrealql(): LanguageSupport;