mirror of
https://github.com/windmill-labs/windmill.git
synced 2026-09-09 16:05:42 +00:00
fix: update monaco configurations
This commit is contained in:
@@ -754,20 +754,20 @@
|
||||
]
|
||||
}
|
||||
)
|
||||
} else if (lang === 'javascript') {
|
||||
} else if (lang === 'typescript') {
|
||||
const stdLib = { content: libStdContent, filePath: 'es6.d.ts' }
|
||||
if (scriptLang == 'bun') {
|
||||
languages.typescript.javascriptDefaults.setExtraLibs([stdLib])
|
||||
languages.typescript.typescriptDefaults.setExtraLibs([stdLib])
|
||||
} else {
|
||||
const denoFetch = { content: denoFetchContent, filePath: 'deno_fetch.d.ts' }
|
||||
languages.typescript.javascriptDefaults.setExtraLibs([stdLib, denoFetch])
|
||||
languages.typescript.typescriptDefaults.setExtraLibs([stdLib, denoFetch])
|
||||
}
|
||||
if (scriptLang == 'bun' && ata == undefined) {
|
||||
const addLibraryToRuntime = async (code: string, _path: string) => {
|
||||
const path = 'file://' + _path
|
||||
let uri = mUri.parse(path)
|
||||
console.log('adding library to runtime', path)
|
||||
languages.typescript.javascriptDefaults.addExtraLib(code, path)
|
||||
languages.typescript.typescriptDefaults.addExtraLib(code, path)
|
||||
try {
|
||||
await vscode.workspace.fs.writeFile(uri, new TextEncoder().encode(code))
|
||||
} catch (e) {
|
||||
@@ -1028,18 +1028,24 @@
|
||||
|
||||
initialized = true
|
||||
|
||||
languages.typescript.typescriptDefaults.setModeConfiguration({
|
||||
completionItems: false,
|
||||
definitions: false,
|
||||
hovers: false
|
||||
})
|
||||
|
||||
languages.typescript.typescriptDefaults.setCompilerOptions({
|
||||
target: languages.typescript.ScriptTarget.Latest,
|
||||
allowNonTsExtensions: true,
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: false,
|
||||
|
||||
completionItems: true,
|
||||
hovers: true,
|
||||
documentSymbols: true,
|
||||
definitions: true,
|
||||
references: true,
|
||||
documentHighlights: true,
|
||||
rename: true,
|
||||
diagnostics: true,
|
||||
documentRangeFormattingEdits: true,
|
||||
signatureHelp: true,
|
||||
onTypeFormattingEdits: true,
|
||||
codeActions: true,
|
||||
inlayHints: true,
|
||||
checkJs: true,
|
||||
allowJs: true,
|
||||
noUnusedLocals: true,
|
||||
@@ -1064,7 +1070,25 @@
|
||||
inlayHints: true
|
||||
})
|
||||
|
||||
languages.typescript.typescriptDefaults.setModeConfiguration({
|
||||
completionItems: true,
|
||||
hovers: true,
|
||||
documentSymbols: true,
|
||||
definitions: true,
|
||||
references: true,
|
||||
documentHighlights: true,
|
||||
rename: true,
|
||||
diagnostics: true,
|
||||
documentRangeFormattingEdits: true,
|
||||
signatureHelp: true,
|
||||
onTypeFormattingEdits: true,
|
||||
codeActions: true,
|
||||
inlayHints: true
|
||||
})
|
||||
|
||||
languages.typescript.javascriptDefaults.setEagerModelSync(true)
|
||||
languages.typescript.typescriptDefaults.setEagerModelSync(true)
|
||||
|
||||
languages.typescript.javascriptDefaults.setDiagnosticsOptions({
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: false,
|
||||
@@ -1072,6 +1096,13 @@
|
||||
diagnosticCodesToIgnore: [1108]
|
||||
})
|
||||
|
||||
languages.typescript.typescriptDefaults.setDiagnosticsOptions({
|
||||
noSemanticValidation: false,
|
||||
noSyntaxValidation: false,
|
||||
noSuggestionDiagnostics: false,
|
||||
diagnosticCodesToIgnore: [1108]
|
||||
})
|
||||
|
||||
languages.typescript.javascriptDefaults.setCompilerOptions({
|
||||
target: languages.typescript.ScriptTarget.Latest,
|
||||
allowNonTsExtensions: true,
|
||||
@@ -1083,8 +1114,7 @@
|
||||
noUnusedParameters: true,
|
||||
noUnusedLocals: true,
|
||||
strict: true,
|
||||
noLib: false,
|
||||
|
||||
noLib: true,
|
||||
moduleResolution: languages.typescript.ModuleResolutionKind.NodeJs
|
||||
})
|
||||
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
import { goto } from '$app/navigation'
|
||||
|
||||
export let initialPath: string = ''
|
||||
export let pathStoreInit: string | undefined = undefined
|
||||
export let newFlow: boolean
|
||||
export let selectedId: string | undefined
|
||||
export let initialArgs: Record<string, any> = {}
|
||||
@@ -359,9 +360,9 @@
|
||||
const scriptEditorDrawer = writable<ScriptEditorDrawer | undefined>(undefined)
|
||||
const moving = writable<{ module: FlowModule; modules: FlowModule[] } | undefined>(undefined)
|
||||
const history = initHistory($flowStore)
|
||||
const pathStore = writable<string>(initialPath)
|
||||
const pathStore = writable<string>(pathStoreInit ?? initialPath)
|
||||
|
||||
$: $pathStore = initialPath
|
||||
$: initialPath && ($pathStore = initialPath)
|
||||
|
||||
const testStepStore = writable<Record<string, any>>({})
|
||||
|
||||
|
||||
@@ -17,11 +17,8 @@
|
||||
} from 'monaco-editor'
|
||||
import 'monaco-editor/esm/vs/basic-languages/sql/sql.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/yaml/yaml.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/typescript/typescript.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/javascript/javascript.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/graphql/graphql.contribution'
|
||||
import 'monaco-editor/esm/vs/language/json/monaco.contribution'
|
||||
import 'monaco-editor/esm/vs/language/typescript/monaco.contribution'
|
||||
import 'monaco-editor/esm/vs/basic-languages/css/css.contribution'
|
||||
import 'monaco-editor/esm/vs/language/css/monaco.contribution'
|
||||
|
||||
@@ -329,6 +326,7 @@
|
||||
filePath: 'windmill.d.ts'
|
||||
})
|
||||
}
|
||||
console.log(libs)
|
||||
languages.typescript.javascriptDefaults.setExtraLibs(libs)
|
||||
}
|
||||
}
|
||||
|
||||
-1
@@ -97,7 +97,6 @@
|
||||
lang="javascript"
|
||||
bind:code={componentInput.expr}
|
||||
shouldBindKey={false}
|
||||
domLib
|
||||
{extraLib}
|
||||
autoHeight
|
||||
{fixedOverflowWidgets}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import type { Environment } from 'monaco-editor/esm/vs/editor/editor.api.js'
|
||||
import cssWorker from 'monaco-editor/esm/vs/language/css/css.worker?worker'
|
||||
import htmlWorker from 'monaco-editor/esm/vs/language/html/html.worker?worker'
|
||||
|
||||
import tsWorker from 'monaco-editor/esm/vs/language/typescript/ts.worker?worker'
|
||||
import jsonWorker from 'monaco-editor/esm/vs/language/json/json.worker?worker'
|
||||
import editorWorker from 'monaco-editor/esm/vs/editor/editor.worker?worker'
|
||||
|
||||
@@ -47,13 +47,7 @@ export function buildWorkerDefinition(
|
||||
case 'template':
|
||||
case 'typescript':
|
||||
case 'javascript':
|
||||
return new Worker(
|
||||
new URL(
|
||||
'../../../node_modules/monaco-editor/esm/vs/language/typescript/ts.worker',
|
||||
import.meta.url
|
||||
),
|
||||
{ type: 'module' }
|
||||
)
|
||||
return new tsWorker()
|
||||
case 'html':
|
||||
case 'handlebars':
|
||||
case 'razor':
|
||||
|
||||
+1
-12395
File diff suppressed because it is too large
Load Diff
@@ -7,9 +7,9 @@ export function scriptLangToEditorLang(lang: Script.language) {
|
||||
if (lang == 'deno') {
|
||||
return 'typescript'
|
||||
} else if (lang == 'bun') {
|
||||
return 'javascript'
|
||||
return 'typescript'
|
||||
} else if (lang == 'nativets') {
|
||||
return 'javascript'
|
||||
return 'typescript'
|
||||
// } else if (lang == 'graphql') {
|
||||
// return 'typescript'
|
||||
} else if (lang == 'postgresql') {
|
||||
|
||||
@@ -26,6 +26,7 @@
|
||||
let loading = false
|
||||
|
||||
let initialPath: string | undefined = undefined
|
||||
let pathStoreInit: string | undefined = undefined
|
||||
|
||||
export const flowStore = writable<Flow>({
|
||||
summary: '',
|
||||
@@ -82,7 +83,7 @@
|
||||
])
|
||||
|
||||
flow = state.flow
|
||||
initialPath = state.path
|
||||
pathStoreInit = state.path
|
||||
state?.selectedId && (selectedId = state?.selectedId)
|
||||
} else {
|
||||
if (templatePath) {
|
||||
@@ -134,6 +135,7 @@
|
||||
goto(`/flows/get/${e.detail}?workspace=${$workspaceStore}`)
|
||||
}}
|
||||
{initialPath}
|
||||
{pathStoreInit}
|
||||
bind:getSelectedId
|
||||
bind:this={flowBuilder}
|
||||
newFlow
|
||||
|
||||
Reference in New Issue
Block a user