Skip to content

Commit

Permalink
Merge pull request #3057 from bsorrentino/main
Browse files Browse the repository at this point in the history
Fix issue #2295 - Models with "@" in their name do not resolve as dependencies
  • Loading branch information
hediet committed Aug 3, 2022
2 parents acc3d9a + 675844a commit 913ae66
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/language/typescript/tsWorker.ts
Expand Up @@ -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];
}
}
Expand Down

0 comments on commit 913ae66

Please sign in to comment.