Use Uri.Utils (#160780)

* Use Uri.Utils

* handle base as folder
This commit is contained in:
Martin Aeschlimann
2022-09-13 17:46:01 +02:00
committed by GitHub
parent b24fefc540
commit 5431050e5f
4 changed files with 9 additions and 85 deletions

View File

@@ -30,8 +30,9 @@ export function getDocumentContext(documentUri: string, workspaceFolders: Worksp
return folderUri + ref.substring(1);
}
}
base = base.substring(0, base.lastIndexOf('/') + 1);
return Utils.resolvePath(URI.parse(base), ref).toString(true);
const baseUri = URI.parse(base);
const baseUriDir = baseUri.path.endsWith('/') ? baseUri : Utils.dirname(baseUri);
return Utils.resolvePath(baseUriDir, ref).toString(true);
},
};
}