Attribute indexing and code completion

This commit is contained in:
Zef Hemel
2023-08-01 21:35:19 +02:00
parent 52a28c78a7
commit 701a567c95
10 changed files with 210 additions and 17 deletions
+11
View File
@@ -551,10 +551,21 @@ export class Client {
const line = editorState.doc.lineAt(selection.from);
const linePrefix = line.text.slice(0, selection.from - line.from);
const parentNodes: string[] = [];
const currentNode = syntaxTree(editorState).resolveInner(selection.from);
if (currentNode) {
let node = currentNode;
while (node.parent) {
parentNodes.push(node.parent.name);
node = node.parent;
}
}
const results = await this.dispatchAppEvent(eventName, {
pageName: this.currentPage!,
linePrefix,
pos: selection.from,
parentNodes,
} as CompleteEvent);
let actualResult = null;
for (const result of results) {