9
9
from albert import *
10
10
11
11
md_iid = "2.3"
12
- md_version = "1.3 "
12
+ md_version = "1.4 "
13
13
md_name = "VSCode projects"
14
14
md_description = "Open VSCode projects"
15
15
md_url = "https://github.com/albertlauncher/python/tree/master/vscode_projects"
@@ -372,17 +372,19 @@ def _searchInRecentFiles(self, matcher: Matcher, results: dict[str, SearchResult
372
372
for path in self ._configStoragePaths :
373
373
c = self ._getStorageConfig (path )
374
374
for proj in c .projects :
375
- if matcher .match (proj .name ) or matcher .match (proj .path ):
376
- results [proj .path ] = self ._getHigherPriorityResult (
375
+ # Resolve sym links to get unique results
376
+ resolvedPath = str (Path (proj .path ).resolve ())
377
+ if matcher .match (proj .name ) or matcher .match (proj .path ) or matcher .match (resolvedPath ):
378
+ results [resolvedPath ] = self ._getHigherPriorityResult (
377
379
SearchResult (
378
380
project = proj ,
379
381
priority = self .priorityRecent ,
380
382
sortIndex = sortIndex
381
383
),
382
- results .get (proj . path ),
384
+ results .get (resolvedPath ),
383
385
)
384
386
385
- if results .get (proj . path ) is not None :
387
+ if results .get (resolvedPath ) is not None :
386
388
sortIndex += 1
387
389
388
390
return results
@@ -391,35 +393,37 @@ def _searchInProjectManager(self, matcher: Matcher, results: dict[str, SearchRes
391
393
for path in self ._configProjectManagerPaths :
392
394
c = self ._getProjectManagerConfig (path )
393
395
for proj in c .projects :
396
+ # Resolve sym links to get unique results
397
+ resolvedPath = str (Path (proj .path ).resolve ())
394
398
if matcher .match (proj .name ):
395
- results [proj . path ] = self ._getHigherPriorityResult (
399
+ results [resolvedPath ] = self ._getHigherPriorityResult (
396
400
SearchResult (
397
401
project = proj ,
398
402
priority = self .priorityPMName ,
399
403
sortIndex = 0 if matcher .match (proj .name ).isExactMatch () else 1
400
404
),
401
- results .get (proj . path ),
405
+ results .get (resolvedPath ),
402
406
)
403
407
404
- if matcher .match (proj .path ):
405
- results [proj . path ] = self ._getHigherPriorityResult (
408
+ if matcher .match (proj .path ) or matcher . match ( resolvedPath ) :
409
+ results [resolvedPath ] = self ._getHigherPriorityResult (
406
410
SearchResult (
407
411
project = proj ,
408
412
priority = self .priorityPMPath ,
409
413
sortIndex = 1
410
414
),
411
- results .get (proj . path ),
415
+ results .get (resolvedPath ),
412
416
)
413
417
414
418
for tag in proj .tags :
415
419
if matcher .match (tag ):
416
- results [proj . path ] = self ._getHigherPriorityResult (
420
+ results [resolvedPath ] = self ._getHigherPriorityResult (
417
421
SearchResult (
418
422
project = proj ,
419
423
priority = self .priorityPMTag ,
420
424
sortIndex = 1
421
425
),
422
- results .get (proj . path ),
426
+ results .get (resolvedPath ),
423
427
)
424
428
break
425
429
0 commit comments