mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
This change omits the injection of the template syntaxes inside any existing block scope. The injection is not needed because the template and expression scopes are included explicitly as patterns where appropriate under the template-blocks definitions. This change prevents the interpolation curly braces from superseding the match for the open curly of the block body. This issue also happens with ICUs (#62697), but those do not have any named scopes to exclude as of today. fixes https://github.com/angular/vscode-ng-language-service/issues/1991 PR Close #64392
29 lines
767 B
TypeScript
29 lines
767 B
TypeScript
/**
|
|
* @license
|
|
* Copyright Google Inc. All Rights Reserved.
|
|
*
|
|
* Use of this source code is governed by an MIT-style license that can be
|
|
* found in the LICENSE file at https://angular.io/license
|
|
*/
|
|
|
|
import {GrammarDefinition} from './types';
|
|
|
|
export const Template: GrammarDefinition = {
|
|
scopeName: 'template.ng',
|
|
injectionSelector: 'L:text.html -comment -control.block.ng',
|
|
patterns: [{include: '#interpolation'}],
|
|
repository: {
|
|
interpolation: {
|
|
begin: /{{/,
|
|
beginCaptures: {
|
|
0: {name: 'punctuation.definition.block.ts'},
|
|
},
|
|
end: /}}/,
|
|
endCaptures: {
|
|
0: {name: 'punctuation.definition.block.ts'},
|
|
},
|
|
contentName: 'expression.ng',
|
|
patterns: [{include: 'expression.ng'}],
|
|
},
|
|
},
|
|
};
|