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

1.0.3 • Public • Published

@neo4j-cypher/codemirror

This package provides a variety of extensions to enable cypher language support in codemirror 6.

This package exports those extensions, and provides a convenience method to create an editor with the following API:

// import { EditorView } from 'codemirror';
// import { CypherEditorSupport } from '@neo4j-cypher/editor-support';

const createCypherEditor = (
  parentDOMElement,
  { text = "initial text here", extensions = undefined } = {}
) => {
  // create editor & editorSupport using given extensions, or default extensions if undefined
  const editor = new EditorView({
    parentDOMElement,
    state: initialState // also contains editorSupport for use by extensions
  });
  return {
    editor: EditorView,
    editorSupport: CypherEditorSupport
  };
};

Package Sidebar

Install

npm i @neo4j-cypher/codemirror

Weekly Downloads

2,938

Version

1.0.3

License

Apache-2.0

Unpacked Size

196 kB

Total Files

16

Last publish

Collaborators

  • neo4j-bloom-reader2
  • neo4j-organization