Skip to content

Commit 5510cff

Browse files
authored
refactor autocomplete
1 parent 2a26a37 commit 5510cff

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/extensions/sp_javascriptV2/index.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -90,12 +90,12 @@ function initBlockTools() {
9090
}
9191

9292
let list = [];
93-
if (current) {
93+
if (current && chain.length) {
9494
list = [
9595
...Object.getOwnPropertyNames(current),
9696
...Object.getOwnPropertyNames(current.constructor.prototype)
9797
];
98-
} else if (chain.length === 0 || chain[0] === "window") {
98+
} else {
9999
list.push(...aceCompleteSchema);
100100
list.push("vm");
101101
if (typeof Scratch === "object") list.push("Scratch");
@@ -107,7 +107,7 @@ function initBlockTools() {
107107
caption: word,
108108
value: word,
109109
meta: chain.length ? "child of " + chain[chain.length - 1] : "root",
110-
score: 10000
110+
score: 1000
111111
})));
112112
}
113113
};

0 commit comments

Comments
 (0)