Skip to content

Commit

Permalink
fixup! fix(language-service): Add resource files as roots to their as…
Browse files Browse the repository at this point in the history
…sociated projects
  • Loading branch information
atscott committed May 10, 2022
1 parent 9783f13 commit 263fb33
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions packages/language-service/src/adapters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,12 +105,6 @@ export class LanguageServiceAdapter implements NgCompilerAdapter {
// getScriptInfo() will not create one if it does not exist.
// In this case, we *want* a script info to be created so that we could
// keep track of its version.
const snapshot = this.project.getScriptSnapshot(fileName);
if (!snapshot) {
// This would fail if the file does not exist, or readFile() fails for
// whatever reasons.
throw new Error(`Failed to get script snapshot while trying to read ${fileName}`);
}
const version = this.project.getScriptVersion(fileName);
this.lastReadResourceVersion.set(fileName, version);
const scriptInfo = this.project.getScriptInfo(fileName);
Expand All @@ -126,6 +120,7 @@ export class LanguageServiceAdapter implements NgCompilerAdapter {
if (!this.project.isRoot(scriptInfo)) {
this.project.addRoot(scriptInfo);
}
const snapshot = scriptInfo.getSnapshot();
return snapshot.getText(0, snapshot.getLength());
}

Expand Down

0 comments on commit 263fb33

Please sign in to comment.