feat(language-service): provide completion for $event variable (#34570)
This commit adds a completion for the `$event` variable in bound event expressions. This is the first in a series of PRs to support completions for properties on `$event` variables (https://github.com/angular/vscode-ng-language-service/issues/531). PR Close #34570
This commit is contained in:

committed by
Andrew Kushnir

parent
90b303faa3
commit
24864ee71e
@ -753,6 +753,16 @@ describe('completions', () => {
|
||||
expectContain(completions, CompletionKind.VARIABLE, ['$event']);
|
||||
});
|
||||
});
|
||||
|
||||
describe('$event completions', () => {
|
||||
it('should suggest $event in event bindings', () => {
|
||||
mockHost.override(TEST_TEMPLATE, `<div (click)="myClick(~{cursor});"></div>`);
|
||||
const marker = mockHost.getLocationMarkerFor(TEST_TEMPLATE, 'cursor');
|
||||
debugger;
|
||||
const completions = ngLS.getCompletionsAt(TEST_TEMPLATE, marker.start);
|
||||
expectContain(completions, CompletionKind.VARIABLE, ['$event']);
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function expectContain(
|
||||
|
Reference in New Issue
Block a user