diff --git a/src/datasource/sql-query/sql-query-helper.ts b/src/datasource/sql-query/sql-query-helper.ts index 5fe18b8b9..4aee3e938 100644 --- a/src/datasource/sql-query/sql-query-helper.ts +++ b/src/datasource/sql-query/sql-query-helper.ts @@ -110,7 +110,9 @@ export class SqlQueryHelper { } } if (done === 0) { - throw { message: '$conditionalTest macros error cannot find referenced variable: ' + param2 }; + // TODO: Refactor logic + // throw { message: '$conditionalTest macros error cannot find referenced variable: ' + param2 }; + break; } openMacros = query.indexOf(macros); } diff --git a/src/views/QueryEditor/components/QueryTextEditor/editor/initiateEditor.ts b/src/views/QueryEditor/components/QueryTextEditor/editor/initiateEditor.ts index e8ae39990..51bb53eae 100644 --- a/src/views/QueryEditor/components/QueryTextEditor/editor/initiateEditor.ts +++ b/src/views/QueryEditor/components/QueryTextEditor/editor/initiateEditor.ts @@ -138,7 +138,7 @@ export const initiateEditor = (templateVariables: any, monacoInstance: any) => { array.map(item => createCompletionItem(item, kind, item, range)); // @ts-ignore const mapMacroToCompletionItems = (array: Array<{ name: string; def: string; docText: string }>, kind: monacoInstance.languages.CompletionItemKind) => - array.map(item => createCompletionItem(item.name, kind, item.def, rangeMacros, item.docText)); + array.map(item => createCompletionItem(item.name, kind, item.name, rangeMacros, item.docText)); // @ts-ignore const mapFunctionToCompletionItems = (array: Array<{ name: string; def: string; docText: string }>, kind: monacoInstance.languages.CompletionItemKind) => array.map(item => createCompletionItem(item.name, kind, item.def, range, item.docText));