Skip to content

Commit

Permalink
feat: add audio cue in demo
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Mar 20, 2023
1 parent f2409d2 commit 326ef9c
Show file tree
Hide file tree
Showing 6 changed files with 19 additions and 10 deletions.
2 changes: 2 additions & 0 deletions demo/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"start": "vite --config vite.config.ts",
"start:debug": "vite --config vite.config.ts --debug --force",
"build": "vite --config vite.config.ts build",
"build:github": "vite --config vite.config.ts build --base=/monaco-vscode-api && touch dist/.nojekyll"
"build:github": "vite --config vite.github-page.config.ts build && touch dist/.nojekyll"
},
"devDependencies": {
"@types/throttle-debounce": "~5.0.0",
Expand Down
3 changes: 2 additions & 1 deletion demo/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ const settingsModel = monaco.editor.createModel(
"editor.foldingHighlight": false,
"editor.semanticHighlighting.enabled": true,
"editor.bracketPairColorization.enabled": false,
"editor.fontSize": 12
"editor.fontSize": 12,
"audioCues.lineHasError": "on"
}`, 'json', monaco.Uri.file('/settings.json'))
createConfiguredEditor(document.getElementById('settings-editor')!, {
model: settingsModel
Expand Down
10 changes: 4 additions & 6 deletions demo/src/setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGot
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneGotoSymbolQuickAccess'
import 'monaco-editor/esm/vs/editor/standalone/browser/quickAccess/standaloneCommandsQuickAccess'
import 'monaco-editor/esm/vs/editor/standalone/browser/referenceSearch/standaloneReferenceSearch'
import onigFile from 'vscode-oniguruma/release/onig.wasm?url'
import { StandaloneServices } from 'vscode/services'
import getModelEditorServiceOverride from 'vscode/service-override/modelEditor'
import getNotificationServiceOverride from 'vscode/service-override/notifications'
Expand All @@ -18,6 +17,7 @@ import getThemeServiceOverride, { setDefaultThemes, IThemeExtensionPoint } from
import geTokenClassificationServiceOverride from 'vscode/service-override/tokenClassification'
import getLanguageConfigurationServiceOverride, { setLanguageConfiguration } from 'vscode/service-override/languageConfiguration'
import getLanguagesServiceOverride, { setLanguages } from 'vscode/service-override/languages'
import getAudioCueServiceOverride from 'vscode/service-override/audioCue'
import EditorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
import JsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
import themes from './resources/themes/themes.json'
Expand Down Expand Up @@ -53,14 +53,12 @@ StandaloneServices.initialize({
...getDialogsServiceOverride(),
...getConfigurationServiceOverride(),
...getKeybindingsServiceOverride(),
...getTextmateServiceOverride(async () => {
const response = await fetch(onigFile)
return await response.arrayBuffer()
}),
...getTextmateServiceOverride(),
...getThemeServiceOverride(),
...geTokenClassificationServiceOverride(),
...getLanguageConfigurationServiceOverride(),
...getLanguagesServiceOverride()
...getLanguagesServiceOverride(),
...getAudioCueServiceOverride()
})

const loader: Partial<Record<string, () => Promise<string>>> = {
Expand Down
6 changes: 4 additions & 2 deletions demo/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ import { defineConfig } from 'vite'

export default defineConfig({
server: {
origin: 'http://localhost:5173',
fs: {
allow: ['../'] // allow to load codicon.tss from monaco-editor in the parent folder
allow: ['../'] // allow to load codicon.ttf from monaco-editor in the parent folder
}
}
},
assetsInclude: ['**/*.wasm']
})
6 changes: 6 additions & 0 deletions demo/vite.github-page.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import { defineConfig } from 'vite'

export default defineConfig({
base: 'https://codingame.github.io/monaco-vscode-api',
assetsInclude: ['**/*.wasm']
})

0 comments on commit 326ef9c

Please sign in to comment.