mirror of
https://github.com/pybricks/pybricks-code.git
synced 2026-07-28 04:08:05 +00:00
editor/sagas: maintain jedi sort order
Now that jedi returns names that start with `_`, we need to make sure they don't end up at the top of the list for completions.
This commit is contained in:
+9
-1
@@ -698,7 +698,15 @@ function* runJedi(): Generator {
|
||||
}
|
||||
|
||||
if (pythonMessageDidComplete.matches(msg.data)) {
|
||||
const list = JSON.parse(msg.data.completionListJson);
|
||||
const list: monaco.languages.CompletionItem[] = JSON.parse(
|
||||
msg.data.completionListJson,
|
||||
);
|
||||
|
||||
// maintain sort order from jedi
|
||||
for (const [i, item] of list.entries()) {
|
||||
item.sortText = String(i).padStart(5, '0');
|
||||
}
|
||||
|
||||
console.debug(list);
|
||||
complete.resolve({ suggestions: list });
|
||||
console.debug(`${id}: resolved: ${msg.data.type}`);
|
||||
|
||||
Reference in New Issue
Block a user