enhance tag matching logic in findCompletionCandidates function

This commit is contained in:
newtextdoc1111
2025-05-06 00:48:06 +09:00
parent 6bb3acc825
commit 3004d842d4
+6 -1
View File
@@ -559,7 +559,12 @@ function findCompletionCandidates(query) {
// Check primary tag against all variations
for (const variation of queryVariations) {
// Ensure tagData.tag is treated as lowercase for comparison
if (tagData.tag.toLowerCase().includes(variation)) {
const lowerTag = tagData.tag.toLowerCase();
if (lowerTag.includes(variation)) {
matched = true;
break;
} else if (lowerTag.replace(/[\-_]/g, '').includes(variation)) {
// Try to match with underscores removed
matched = true;
break;
}