@@ -17,7 +17,7 @@ import {isNamedClassDeclaration} from '@angular/compiler-cli/src/ngtsc/reflectio
1717import { OptimizeFor } from '@angular/compiler-cli/src/ngtsc/typecheck/api' ;
1818import ts from 'typescript/lib/tsserverlibrary' ;
1919
20- import { GetComponentLocationsForTemplateResponse , GetTcbResponse , GetTemplateLocationForComponentResponse } from '../api' ;
20+ import { GetComponentLocationsForTemplateResponse , GetTcbResponse , GetTemplateLocationForComponentResponse , PluginConfig } from '../api' ;
2121
2222import { LanguageServiceAdapter , LSParseConfigHost } from './adapters' ;
2323import { ALL_CODE_FIXES_METAS , CodeFixes } from './codefixes' ;
@@ -33,13 +33,7 @@ import {getTargetAtPosition, getTcbNodesOfTemplateAtPosition, TargetNodeKind} fr
3333import { findTightestNode , getClassDeclFromDecoratorProp , getParentClassDeclaration , getPropertyAssignmentFromValue } from './ts_utils' ;
3434import { getTemplateInfoAtPosition , isTypeScriptFile } from './utils' ;
3535
36- interface LanguageServiceConfig {
37- /**
38- * If true, enable `strictTemplates` in Angular compiler options regardless
39- * of its value in tsconfig.json.
40- */
41- forceStrictTemplates ?: true ;
42- }
36+ type LanguageServiceConfig = Omit < PluginConfig , 'angularOnly' > ;
4337
4438export class LanguageService {
4539 private options : CompilerOptions ;
@@ -52,7 +46,7 @@ export class LanguageService {
5246 constructor (
5347 private readonly project : ts . server . Project ,
5448 private readonly tsLS : ts . LanguageService ,
55- private readonly config : LanguageServiceConfig ,
49+ private readonly config : Omit < PluginConfig , 'angularOnly' > ,
5650 ) {
5751 this . parseConfigHost = new LSParseConfigHost ( project . projectService . host ) ;
5852 this . options = parseNgCompilerOptions ( project , this . parseConfigHost , config ) ;
@@ -525,6 +519,9 @@ function parseNgCompilerOptions(
525519 if ( config . forceStrictTemplates === true ) {
526520 options . strictTemplates = true ;
527521 }
522+ if ( config . enableBlockSyntax === false ) {
523+ options [ '_enableBlockSyntax' ] = false ;
524+ }
528525
529526 return options ;
530527}
0 commit comments