Skip to content

Commit 57e1114

Browse files
committed
feat: add svelte language to CodeMirror
1 parent cc50ad4 commit 57e1114

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

packages/components/react/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@
6969
"@lezer/highlight": "^1.2.0",
7070
"@nanostores/react": "0.7.2",
7171
"@radix-ui/react-accordion": "^1.2.0",
72+
"@replit/codemirror-lang-svelte": "^6.0.0",
7273
"@tutorialkit/runtime": "workspace:*",
7374
"@tutorialkit/theme": "workspace:*",
7475
"@webcontainer/api": "1.2.0",

packages/components/react/src/core/CodeMirrorEditor/languages.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,13 @@ export const supportedLanguages = [
7878
return import('@codemirror/lang-wast').then((module) => module.wast());
7979
},
8080
}),
81+
LanguageDescription.of({
82+
name: 'Svelte',
83+
extensions: ['svelte'],
84+
async load() {
85+
return import('@replit/codemirror-lang-svelte').then((module) => module.svelte());
86+
},
87+
}),
8188
];
8289

8390
export async function getLanguage(fileName: string) {

0 commit comments

Comments
 (0)