Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

An addon for supporting SurrealQL within your CodeMirror editors

License

NotificationsYou must be signed in to change notification settings

surrealdb/codemirror


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
  • Support for linting of supported syntax based on version

How to install

Install it with:

# using npmnpm i @surrealdb/codemirror# or using pnpmpnpm i @surrealdb/codemirror# or using yarnyarn 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";conststate=EditorState.create({doc:"SELECT * FROM table",extensions:[surrealql()]});consteditor=newEditorView({parent:document.getElementById("editor"),state:state,});
import{surrealql,surrealqlVersionLinter}from"@surrealdb/codemirror";conststate=EditorState.create({doc:"SELECT * FROM table",extensions:[surrealql(),surrealqlVersionLinter("2.0.0")]});consteditor=newEditorView({parent:document.getElementById("editor"),state:state,});

@surrealdb/lezer

This package contains the low levelLezer grammar used to perform SurrealQL syntax highlighting.

We recommend using@surrealdb/codemirror as it extends the grammar with additional CodeMirror supported functionality.


[8]ページ先頭

©2009-2025 Movatter.jp