Skip to content

Commit 0e6f108

Browse files
committed
[vscode_projects:1.8] Drop string normalization in favor of native Matcher
1 parent af77348 commit 0e6f108

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

vscode_projects/__init__.py

+4-10
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,12 @@
33

44
import os
55
import json
6-
import unicodedata
76
from pathlib import Path
87
from dataclasses import dataclass
98
from albert import *
109

1110
md_iid = "3.0"
12-
md_version = "1.7"
11+
md_version = "1.8"
1312
md_name = "VSCode projects"
1413
md_description = "Open VSCode projects"
1514
md_url = "https://github.com/albertlauncher/python/tree/master/vscode_projects"
@@ -302,11 +301,6 @@ def _initConfiguration(self):
302301
if terminalCommand is not None:
303302
self._terminalCommand = terminalCommand
304303

305-
# Strings are normalized to match without accents and casing
306-
def _normalizeString(self, input: str) -> str:
307-
return ''.join(c for c in unicodedata.normalize('NFD', input)
308-
if unicodedata.category(c) != 'Mn').lower()
309-
310304
def handleTriggerQuery(self, query):
311305
if not query.isValid:
312306
return
@@ -494,7 +488,7 @@ def _getStorageConfig(self, path: str) -> CachedConfig:
494488
# Inject the project
495489
c.projects.append(Project(
496490
displayName=displayName,
497-
name=self._normalizeString(displayName),
491+
name=displayName,
498492
path=recentPath,
499493
tags=[],
500494
))
@@ -536,15 +530,15 @@ def _getProjectManagerConfig(self, path: str) -> CachedConfig:
536530

537531
project = Project(
538532
displayName=p["name"],
539-
name=self._normalizeString(p["name"]),
533+
name=p["name"],
540534
path=rootPath,
541535
tags=[],
542536
)
543537

544538
# Search against the query string
545539
if "tags" in p:
546540
for tag in p["tags"]:
547-
project.tags.append(self._normalizeString(tag))
541+
project.tags.append(tag)
548542

549543
c.projects.append(project)
550544

0 commit comments

Comments
 (0)