fix(editor): Omit pairedItem from proxy completions (#5098)

*  Omit `pairedItem` from proxy completions

* 🧪 Fix tests
This commit is contained in:
Iván Ovejero 2023-01-09 11:44:52 +01:00 committed by GitHub
parent bae1487a53
commit 320e646380
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 4 deletions

View file

@ -21,7 +21,7 @@ export const nodeSelectorProxy = new Proxy(
{},
{
ownKeys() {
return ['all', 'context', 'first', 'item', 'last', 'params', 'pairedItem', 'itemMatching'];
return ['all', 'context', 'first', 'item', 'last', 'params', 'itemMatching'];
},
get(_, property) {
if (property === 'all') return [];
@ -30,7 +30,6 @@ export const nodeSelectorProxy = new Proxy(
if (property === 'item') return {};
if (property === 'last') return {};
if (property === 'params') return {};
if (property === 'pairedItem') return {};
if (property === 'itemMatching') return {};
return undefined;
@ -39,7 +38,7 @@ export const nodeSelectorProxy = new Proxy(
);
export const itemProxy = new Proxy(
{ json: {}, pairedItem: {} },
{ json: {} },
{
get(_, property) {
if (property === 'json') return {};

View file

@ -56,7 +56,7 @@ export function proxyCompletions(context: CompletionContext): CompletionResult |
}
function generateOptions(toResolve: string, proxy: IDataObject, word: Word): Completion[] {
const SKIP_SET = new Set(['__ob__']);
const SKIP_SET = new Set(['__ob__', 'pairedItem']);
if (word.text.includes('json[')) {
return Object.keys(proxy.json as object)