Skip to content

Commit 6d606a3

Browse files
committed
feat: add emmet to monaco
1 parent d04bbb5 commit 6d606a3

File tree

3 files changed

+20
-4
lines changed

3 files changed

+20
-4
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@
7474
"bumpp": "^9.1.1",
7575
"codemirror": "^5.65.14",
7676
"emmet": "^2.4.4",
77+
"emmet-monaco-es": "^5.3.0",
7778
"fflate": "^0.8.0",
7879
"hash-sum": "^2.0.0",
7980
"monaco-editor-core": "^0.40.0",

pnpm-lock.yaml

Lines changed: 16 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/monaco/env.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
import { jsDelivrUriBase } from '@volar/cdn'
22
import * as volar from '@volar/monaco'
3+
import * as monaco from 'monaco-editor-core'
34
import { editor, languages, Uri } from 'monaco-editor-core'
45
import editorWorker from 'monaco-editor-core/esm/vs/editor/editor.worker?worker'
6+
import { emmetHTML } from 'emmet-monaco-es'
57
import * as onigasm from 'onigasm'
68
import onigasmWasm from 'onigasm/lib/onigasm.wasm?url'
79
import { watchEffect } from 'vue'
@@ -15,6 +17,7 @@ export function initMonaco(store: Store) {
1517
if (initted) return
1618
loadMonacoEnv(store)
1719
loadWasm()
20+
emmetHTML(monaco, ['vue', 'html'])
1821

1922
watchEffect(() => {
2023
// create a model for each file in the store

0 commit comments

Comments
 (0)