Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(language-service): rename host to tsLsHost #32346

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/language-service/src/language_service.ts
Expand Up @@ -86,7 +86,7 @@ class LanguageServiceImpl implements LanguageService {
if (fileName.endsWith('.ts')) {
const sf = this.host.getSourceFile(fileName);
if (sf) {
return getTsDefinitionAndBoundSpan(sf, position, this.host.host);
return getTsDefinitionAndBoundSpan(sf, position, this.host.tsLsHost);
}
}
}
Expand Down
9 changes: 5 additions & 4 deletions packages/language-service/src/typescript_host.ts
Expand Up @@ -72,7 +72,8 @@ export class TypeScriptServiceHost implements LanguageServiceHost {
ngModules: [],
};

constructor(readonly host: ts.LanguageServiceHost, private readonly tsLS: ts.LanguageService) {
constructor(
readonly tsLsHost: ts.LanguageServiceHost, private readonly tsLS: ts.LanguageService) {
this.summaryResolver = new AotSummaryResolver(
{
loadSummary(filePath: string) { return null; },
Expand All @@ -81,7 +82,7 @@ export class TypeScriptServiceHost implements LanguageServiceHost {
fromSummaryFileName(filePath: string): string{return filePath;},
},
this.staticSymbolCache);
this.reflectorHost = new ReflectorHost(() => this.program, host);
this.reflectorHost = new ReflectorHost(() => this.program, tsLsHost);
this.staticSymbolResolver = new StaticSymbolResolver(
this.reflectorHost, this.staticSymbolCache, this.summaryResolver,
(e, filePath) => this.collectError(e, filePath));
Expand Down Expand Up @@ -277,7 +278,7 @@ export class TypeScriptServiceHost implements LanguageServiceHost {
for (const sourceFile of program.getSourceFiles()) {
const fileName = sourceFile.fileName;
seen.add(fileName);
const version = this.host.getScriptVersion(fileName);
const version = this.tsLsHost.getScriptVersion(fileName);
const lastVersion = this.fileVersions.get(fileName);
if (version !== lastVersion) {
this.fileVersions.set(fileName, version);
Expand Down Expand Up @@ -333,7 +334,7 @@ export class TypeScriptServiceHost implements LanguageServiceHost {
*/
private getExternalTemplate(fileName: string): TemplateSource|undefined {
// First get the text for the template
const snapshot = this.host.getScriptSnapshot(fileName);
const snapshot = this.tsLsHost.getScriptSnapshot(fileName);
if (!snapshot) {
return;
}
Expand Down