feat(editor): Introduce proxy completions to expressions (#5075)
* ⚡ Introduce proxy completions to expressions * 🧪 Add tests * ⚡ Replace snippet with alphabetic char completions * ⚡ Tighten `DateTime` check * 🧹 Clean up `n8nLang` * 🔥 Remove duplicate * 👕 Remove non-null assertion * ⚡ Confirm that `overlay` is needed * 🔥 Remove comment * 🔥 Remove more unneeded code * 🔥 Remove unneded Pinia setup * ⚡ Simplify syntax
This commit is contained in:
@@ -1,11 +1,12 @@
|
||||
import Vue from 'vue';
|
||||
import { isAllowedInDotNotation, escape, toVariableOption } from '../utils';
|
||||
import { escape, toVariableOption } from '../utils';
|
||||
import type { Completion, CompletionContext, CompletionResult } from '@codemirror/autocomplete';
|
||||
import type { IDataObject, IPinData, IRunData } from 'n8n-workflow';
|
||||
import type { CodeNodeEditorMixin } from '../types';
|
||||
import { mapStores } from 'pinia';
|
||||
import { useWorkflowsStore } from '@/stores/workflows';
|
||||
import { useNDVStore } from '@/stores/ndv';
|
||||
import { isAllowedInDotNotation } from '@/plugins/codemirror/completions/utils';
|
||||
|
||||
export const jsonFieldCompletions = (Vue as CodeNodeEditorMixin).extend({
|
||||
computed: {
|
||||
|
||||
@@ -76,7 +76,7 @@ export const luxonCompletions = (Vue as CodeNodeEditorMixin).extend({
|
||||
/**
|
||||
* Complete `DateTime` with luxon `DateTime` static methods.
|
||||
*/
|
||||
dateTimeCompltions(context: CompletionContext, matcher = 'DateTime'): CompletionResult | null {
|
||||
dateTimeCompletions(context: CompletionContext, matcher = 'DateTime'): CompletionResult | null {
|
||||
const pattern = new RegExp(`${escape(matcher)}\..*`);
|
||||
|
||||
const preCursor = context.matchBefore(pattern);
|
||||
|
||||
Reference in New Issue
Block a user