Skip to content
This repository was archived by the owner on Oct 15, 2025. It is now read-only.

Commit e57af0e

Browse files
committed
[vscode_projects:1.9] Optimize adding items to query
1 parent e3bbeae commit e57af0e

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

vscode_projects/__init__.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from albert import *
99

1010
md_iid = "3.0"
11-
md_version = "1.8"
11+
md_version = "1.9"
1212
md_name = "VSCode projects"
1313
md_description = "Open VSCode projects"
1414
md_url = "https://github.com/albertlauncher/python/tree/master/vscode_projects"
@@ -321,8 +321,11 @@ def handleTriggerQuery(self, query):
321321
sortedItems = sorted(results.values(), key=lambda item: "%s_%s_%s" % (
322322
'{:03d}'.format(item.priority), '{:03d}'.format(item.sortIndex), item.project.name), reverse=False)
323323

324+
items: list[StandardItem] = []
324325
for i in sortedItems:
325-
query.add(self._createItem(i.project, query))
326+
items.append(self._createItem(i.project, query))
327+
328+
query.add(items)
326329

327330
# Creates an item for the query based on the project and plugin settings
328331
def _createItem(self, project: Project, query: Query) -> StandardItem:

0 commit comments

Comments
 (0)