@surrealdb/codemirror
TypeScript icon, indicating that this package has built-in type declarations

1.0.0-beta.19 • Public • Published

SurrealQL Support for CodeMirror


 

     

@surrealdb/codemirror

This library provides full support for the SurrealQL language within your CodeMirror editors.

Some features include:

  • Intelligent SurrealQL highlighting
  • Folding support for blocks, objects, and arrays
  • Automatic indentation support
  • Support for comment toggling
  • Embedded JavaScript highlighting

How to install

Install it with:

# using npm
npm i @surrealdb/codemirror
# or using pnpm
pnpm i @surrealdb/codemirror
# or using yarn
yarn add @surrealdb/codemirror

Next, just import it with:

const { surrealql } = require("@surrealdb/codemirror");

or when you use modules:

import { surrealql } from "@surrealdb/codemirror";

Example usage

import { surrealql } from "@surrealdb/codemirror";

const state = EditorState.create({
    doc: "SELECT * FROM table",
    extensions: [
        surrealql()
    ]
});

const editor = new EditorView({
    parent: document.getElementById("editor"),
    state: state,
});

Versions

Current Tags

VersionDownloads (Last 7 Days)Tag
1.0.0-beta.1917latest

Version History

VersionDownloads (Last 7 Days)Published
1.0.0-beta.1917
1.0.0-beta.1814
1.0.0-beta.172
1.0.0-beta.160
1.0.0-beta.150
1.0.0-beta.140
1.0.0-beta.130
1.0.0-beta.120
1.0.0-beta.110
1.0.0-beta.100
1.0.0-beta.90
1.0.0-beta.80
1.0.0-beta.70
1.0.0-beta.60
1.0.0-beta.51
1.0.0-beta.40
1.0.0-beta.30
1.0.0-beta.20
1.0.0-beta.10

Package Sidebar

Install

npm i @surrealdb/codemirror

Weekly Downloads

13

Version

1.0.0-beta.19

License

none

Unpacked Size

25.7 kB

Total Files

8

Last publish

Collaborators

  • tobiemh
  • kearfy