feat(language-service): add quick info for inline templates in ivy (#39060)
Adds implementation for `getQuickInfoAtPosition` to the Ivy Language Service, which now returns `ts.QuickInfo` for inline templates. PR Close #39060
This commit is contained in:

committed by
Joey Perrott

parent
4fe673d518
commit
904adb72d2
@ -16,6 +16,8 @@ import {TypeCheckShimGenerator} from '@angular/compiler-cli/src/ngtsc/typecheck'
|
||||
import {OptimizeFor, TypeCheckingProgramStrategy} from '@angular/compiler-cli/src/ngtsc/typecheck/api';
|
||||
import * as ts from 'typescript/lib/tsserverlibrary';
|
||||
|
||||
import {QuickInfoBuilder} from './quick_info';
|
||||
|
||||
export class LanguageService {
|
||||
private options: CompilerOptions;
|
||||
private lastKnownProgram: ts.Program|null = null;
|
||||
@ -45,6 +47,12 @@ export class LanguageService {
|
||||
throw new Error('Ivy LS currently does not support external template');
|
||||
}
|
||||
|
||||
getQuickInfoAtPosition(fileName: string, position: number): ts.QuickInfo|undefined {
|
||||
const program = this.strategy.getProgram();
|
||||
const compiler = this.createCompiler(program);
|
||||
return new QuickInfoBuilder(this.tsLS, compiler).get(fileName, position);
|
||||
}
|
||||
|
||||
private createCompiler(program: ts.Program): NgCompiler {
|
||||
return new NgCompiler(
|
||||
this.adapter,
|
||||
|
Reference in New Issue
Block a user