Merge pull request #3057 from bsorrentino/main

Fix issue #2295 - Models with "@" in their name do not resolve as dependencies
This commit is contained in:
Henning Dieterichs 2022-08-03 17:31:50 +02:00 committed by GitHub
commit 913ae66ad8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -63,14 +63,15 @@ export class TypeScriptWorker implements ts.LanguageServiceHost, ITypeScriptWork
getScriptFileNames(): string[] {
const allModels = this._ctx.getMirrorModels().map((model) => model.uri);
const models = allModels.filter((uri) => !fileNameIsLib(uri)).map((uri) => uri.toString());
const models = allModels.filter((uri) => !fileNameIsLib(uri)).map((uri) => uri.toString(true));
return models.concat(Object.keys(this._extraLibs));
}
private _getModel(fileName: string): worker.IMirrorModel | null {
let models = this._ctx.getMirrorModels();
for (let i = 0; i < models.length; i++) {
if (models[i].uri.toString() === fileName) {
const uri = models[i].uri;
if (uri.toString() === fileName || uri.toString(true) === fileName) {
return models[i];
}
}