Skip to content

Commit b4ae362

Browse files
author
Calvinn Ng
committed
feature: add imported functions/files to context
1 parent ca92c3a commit b4ae362

File tree

2 files changed

+450
-63
lines changed
  • core/autocomplete
  • extensions/vscode/src/autocomplete

2 files changed

+450
-63
lines changed

core/autocomplete/ast.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ export async function getTreePathAtCursor(
2828
while (path[path.length - 1].childCount > 0) {
2929
let foundChild = false;
3030
for (let child of path[path.length - 1].children) {
31+
if (child.type == "import_statement") {
32+
path.push(child);
33+
}
34+
3135
if (child.startIndex <= cursorIndex && child.endIndex >= cursorIndex) {
3236
path.push(child);
3337
foundChild = true;

0 commit comments

Comments
 (0)