An open API service indexing awesome lists of open source software.

https://github.com/replit/codemirror-lang-svelte

Svelte language support for CodeMirror 6
https://github.com/replit/codemirror-lang-svelte

Last synced: 9 months ago
JSON representation

Svelte language support for CodeMirror 6

Awesome Lists containing this project

README

          

# CodeMirror Svelte Mode

This is a CodeMirror 6 extension that adds support for Svelte.

### Usage

```typescript
import { EditorState } from '@codemirror/state';
import { EditorView } from '@codemirror/view';
import { svelte } from "@replit/codemirror-lang-svelte";
import { basicSetup } from 'codemirror';

new EditorView({
state: EditorState.create({
doc: `let a = "hello world";

{a}
`,
extensions: [basicSetup, svelte()],
}),
parent: document.querySelector('#editor'),
});
```