Skip to content

Commit

Permalink
refactor: split monaco features
Browse files Browse the repository at this point in the history
Signed-off-by: Pedro Lamas <[email protected]>
  • Loading branch information
pedrolamas committed Dec 21, 2022
1 parent 0b981ee commit 78f2780
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 14 deletions.
12 changes: 12 additions & 0 deletions src/components/widgets/filesystem/setupMonaco.features.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import 'monaco-editor/esm/vs/editor/editor.all.js'

// full list of features on 'monaco-editor/esm/metadata.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js'

import 'monaco-editor/esm/vs/language/css/monaco.contribution'
import 'monaco-editor/esm/vs/language/json/monaco.contribution'
import 'monaco-editor/esm/vs/basic-languages/css/css.contribution'
import 'monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution'
18 changes: 4 additions & 14 deletions src/components/widgets/filesystem/setupMonaco.ts
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
import 'monaco-editor/esm/vs/editor/editor.all.js'

// full list of features on 'monaco-editor/esm/metadata.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/accessibilityHelp/accessibilityHelp.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/iPadShowKeyboard/iPadShowKeyboard.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoLineQuickAccess.js'
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess.js'

import 'monaco-editor/esm/vs/language/css/monaco.contribution'
import 'monaco-editor/esm/vs/language/json/monaco.contribution'
import 'monaco-editor/esm/vs/basic-languages/css/css.contribution'
import 'monaco-editor/esm/vs/basic-languages/markdown/markdown.contribution'

import * as monaco from 'monaco-editor/esm/vs/editor/editor.api'

import { loadWASM } from 'onigasm'
Expand Down Expand Up @@ -57,7 +44,10 @@ const getDocsSection = (service: CodeLensSupportedService, sectionName: string)
}

async function setupMonaco () {
await loadWASM(onigasmWasm)
await Promise.all([
loadWASM(onigasmWasm),
import('./setupMonaco.features')
])

// Register our custom TextMate languages.
const registry = new Registry({
Expand Down

0 comments on commit 78f2780

Please sign in to comment.