mirror of
https://github.com/n8n-io/n8n.git
synced 2025-03-05 20:50:17 -08:00
⚡ Improve default types if there is not execution data
This commit is contained in:
parent
4ab7257c2b
commit
cc4f16f419
|
@ -213,9 +213,17 @@ export default mixins(
|
||||||
autoCompleteItems.push(`const $node = ${JSON.stringify(nodes)}`);
|
autoCompleteItems.push(`const $node = ${JSON.stringify(nodes)}`);
|
||||||
|
|
||||||
if (this.codeAutocomplete === 'function') {
|
if (this.codeAutocomplete === 'function') {
|
||||||
|
if (connectionInputData) {
|
||||||
autoCompleteItems.push(`const items = ${JSON.stringify(this.createSimpleRepresentation(connectionInputData))}`);
|
autoCompleteItems.push(`const items = ${JSON.stringify(this.createSimpleRepresentation(connectionInputData))}`);
|
||||||
|
} else {
|
||||||
|
autoCompleteItems.push(`const items: {json: any}[] = []`);
|
||||||
|
}
|
||||||
} else if (this.codeAutocomplete === 'functionItem') {
|
} else if (this.codeAutocomplete === 'functionItem') {
|
||||||
|
if (connectionInputData) {
|
||||||
autoCompleteItems.push(`const item = $json`);
|
autoCompleteItems.push(`const item = $json`);
|
||||||
|
} else {
|
||||||
|
autoCompleteItems.push(`const item = {}`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
this.monacoLibrary = monaco.languages.typescript.javascriptDefaults.addExtraLib(
|
this.monacoLibrary = monaco.languages.typescript.javascriptDefaults.addExtraLib(
|
||||||
|
|
Loading…
Reference in a new issue