Skip to content

Commit

Permalink
fix(demo): make it build
Browse files Browse the repository at this point in the history
  • Loading branch information
Loïc Mangeonjean committed Apr 17, 2024
1 parent 1d24130 commit 2cb431b
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 22 deletions.
4 changes: 2 additions & 2 deletions demo/src/features/output.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { useHtmlFileSystemProvider } from '../setup.common'
import { ExtensionHostKind, registerExtension } from 'vscode/extensions'
import { useHtmlFileSystemProvider } from '../setup.common'

if (!useHtmlFileSystemProvider) {
const { getApi } = registerExtension({
Expand Down Expand Up @@ -28,4 +28,4 @@ if (!useHtmlFileSystemProvider) {
}
})
})
}
}
5 changes: 2 additions & 3 deletions demo/src/main.common.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import './style.css'
import * as monaco from 'monaco-editor'
import './setup.common'
import { ExtensionHostKind, registerExtension } from 'vscode/extensions'
import { useHtmlFileSystemProvider } from './setup.common'
import './features/output'
import './features/debugger'
import './features/search'
Expand Down Expand Up @@ -51,8 +52,6 @@ import '@codingame/monaco-vscode-markdown-math-default-extension'
import '@codingame/monaco-vscode-npm-default-extension'
import '@codingame/monaco-vscode-media-preview-default-extension'
import '@codingame/monaco-vscode-ipynb-default-extension'
import { ExtensionHostKind, registerExtension } from 'vscode/extensions'
import { useHtmlFileSystemProvider } from './setup.common'

const { getApi } = registerExtension({
name: 'demo-main',
Expand Down
37 changes: 20 additions & 17 deletions demo/src/setup.common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -178,12 +178,11 @@ if (useHtmlFileSystemProvider) {
}, null, 2)))

fileSystemProvider.registerFile(new RegisteredMemoryFile(monaco.Uri.file('/tmp/.vscode/extensions.json'), JSON.stringify({
"recommendations": [
"vscodevim.vim"
recommendations: [
'vscodevim.vim'
]
}, null, 2)))


registerFileSystemOverlay(1, fileSystemProvider)
}

Expand Down Expand Up @@ -211,7 +210,7 @@ window.MonacoEnvironment = {
// Set configuration before initializing service so it's directly available (especially for the theme, to prevent a flicker)
await Promise.all([
initUserConfiguration(defaultConfiguration),
initUserKeybindings(defaultKeybindings),
initUserKeybindings(defaultKeybindings)
])

export const constructOptions: IWorkbenchConstructionOptions = {
Expand Down Expand Up @@ -244,19 +243,23 @@ export const constructOptions: IWorkbenchConstructionOptions = {
'window.title': 'Monaco-Vscode-Api${separator}${dirty}${activeEditorShort}'
},
defaultLayout: {
editors: useHtmlFileSystemProvider ? undefined : [{
uri: monaco.Uri.file('/tmp/test.js'),
viewColumn: 1
}, {
uri: monaco.Uri.file('/tmp/test.md'),
viewColumn: 2
}],
layout: useHtmlFileSystemProvider ? undefined : {
editors: {
orientation: 0,
groups: [{ size: 1 }, { size: 1 }]
}
},
editors: useHtmlFileSystemProvider
? undefined
: [{
uri: monaco.Uri.file('/tmp/test.js'),
viewColumn: 1
}, {
uri: monaco.Uri.file('/tmp/test.md'),
viewColumn: 2
}],
layout: useHtmlFileSystemProvider
? undefined
: {
editors: {
orientation: 0,
groups: [{ size: 1 }, { size: 1 }]
}
},
views: [{
id: 'custom-view'
}],
Expand Down

0 comments on commit 2cb431b

Please sign in to comment.