Merge pull request #277 from Symbiomatrix/embpath

Embedding relative path.
This commit is contained in:
DominikDoom
2024-03-03 13:50:33 +01:00
committed by GitHub
2 changed files with 10 additions and 6 deletions

View File

@@ -32,7 +32,11 @@ class EmbeddingParser extends BaseTagParser {
// Add final results
let finalResults = [];
tempResults.forEach(t => {
let result = new AutocompleteResult(t[0].trim(), ResultType.embedding)
let lastDot = t[0].lastIndexOf(".") > -1 ? t[0].lastIndexOf(".") : t[0].length;
let lastSlash = t[0].lastIndexOf("/") > -1 ? t[0].lastIndexOf("/") : -1;
let name = t[0].trim().substring(lastSlash + 1, lastDot);
let result = new AutocompleteResult(name, ResultType.embedding)
result.sortKey = t[1];
result.meta = t[2] + " Embedding";
finalResults.push(result);