fix(language-service): Remove completions for let and of in ngFor (#34434)
`let` and `of` should be considered reserved keywords in template syntax and thus should not be part of the autocomplete suggestions. For reference, TypeScript does not provide such completions. This commit removes these results and cleans up the code. PR Close #34434
This commit is contained in:

committed by
Kara Erickson

parent
7916b1e595
commit
ab614802e4
@ -296,12 +296,6 @@ describe('completions', () => {
|
||||
});
|
||||
|
||||
describe('with a *ngFor', () => {
|
||||
it('should include a let for empty attribute', () => {
|
||||
const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'for-empty');
|
||||
const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start);
|
||||
expectContain(completions, CompletionKind.KEY, ['let', 'of']);
|
||||
});
|
||||
|
||||
it('should suggest NgForRow members for let initialization expression', () => {
|
||||
const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'for-let-i-equal');
|
||||
const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start);
|
||||
@ -317,18 +311,6 @@ describe('completions', () => {
|
||||
]);
|
||||
});
|
||||
|
||||
it('should include a let', () => {
|
||||
const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'for-let');
|
||||
const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start);
|
||||
expectContain(completions, CompletionKind.KEY, ['let', 'of']);
|
||||
});
|
||||
|
||||
it('should include an "of"', () => {
|
||||
const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'for-of');
|
||||
const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start);
|
||||
expectContain(completions, CompletionKind.KEY, ['let', 'of']);
|
||||
});
|
||||
|
||||
it('should include field reference', () => {
|
||||
const marker = mockHost.getLocationMarkerFor(PARSING_CASES, 'for-people');
|
||||
const completions = ngLS.getCompletionsAt(PARSING_CASES, marker.start);
|
||||
|
Reference in New Issue
Block a user