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
- Host: GitHub
- URL: https://github.com/replit/codemirror-lang-svelte
- Owner: replit
- License: mit
- Created: 2022-11-29T19:40:32.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-06-21T21:28:53.000Z (over 1 year ago)
- Last Synced: 2025-02-02T02:48:41.008Z (about 1 year ago)
- Language: TypeScript
- Size: 415 KB
- Stars: 30
- Watchers: 33
- Forks: 2
- Open Issues: 5
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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'),
});
```