handle better getResoruceValue error for theme
This commit is contained in:
@@ -4,7 +4,6 @@
|
||||
import '@codingame/monaco-vscode-standalone-languages'
|
||||
import '@codingame/monaco-vscode-standalone-typescript-language-features'
|
||||
import processStdContent from '$lib/process.d.ts.txt?raw'
|
||||
import windmillFetchContent from '$lib/windmill_fetch.d.ts.txt?raw'
|
||||
|
||||
languages.typescript.typescriptDefaults.addExtraLib(processStdContent, 'process.d.ts')
|
||||
|
||||
@@ -1179,24 +1178,6 @@
|
||||
if (lang === 'typescript' && scriptLang != 'deno') {
|
||||
const hostname = getHostname()
|
||||
|
||||
// const stdLib = { content: libStdContent, filePath: 'es6.d.ts' }
|
||||
if (scriptLang == 'bun' || scriptLang == 'bunnative') {
|
||||
// const processLib = { content: processStdContent, filePath: 'process.d.ts' }
|
||||
// const domLib = { content: domContent, filePath: 'dom.d.ts' }
|
||||
// languages.typescript.typescriptDefaults.setExtraLibs([stdLib, domLib, processLib])
|
||||
} else {
|
||||
// const denoFetch = { content: denoFetchContent, filePath: 'deno_fetch.d.ts' }
|
||||
// languages.typescript.typescriptDefaults.setExtraLibs([stdLib, denoFetch])
|
||||
let localContent = windmillFetchContent
|
||||
let p = '/tmp/monaco/windmill.d.ts'
|
||||
let nuri = mUri.parse(p)
|
||||
let localModel = meditor.getModel(nuri)
|
||||
if (localModel) {
|
||||
localModel.setValue(localContent)
|
||||
} else {
|
||||
meditor.createModel(localContent, 'typescript', nuri)
|
||||
}
|
||||
}
|
||||
if (scriptLang == 'bun' && ata == undefined) {
|
||||
const addLibraryToRuntime = async (code: string, _path: string) => {
|
||||
const path = 'file://' + _path
|
||||
|
||||
@@ -83,12 +83,17 @@ export async function resolveTheme(
|
||||
if (theme?.type === 'inlined') {
|
||||
css = theme.css
|
||||
} else if (theme?.type === 'path' && theme.path && workspace) {
|
||||
let loadedCss = await ResourceService.getResourceValue({
|
||||
workspace: workspace,
|
||||
path: theme.path
|
||||
})
|
||||
let loadedCss: any = { value: '' }
|
||||
try {
|
||||
loadedCss = await ResourceService.getResourceValue({
|
||||
workspace: workspace,
|
||||
path: theme.path
|
||||
})
|
||||
} catch (e) {
|
||||
console.error('Error loading theme', e)
|
||||
}
|
||||
|
||||
css = (loadedCss as any).value ?? ''
|
||||
css = (loadedCss as any)?.['value'] ?? ''
|
||||
}
|
||||
return css
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user