fix(language-service): Fix completions for input/output with alias (#28904)
This PR fixes a bug in autocompletion for @Input/@Output decorator with an alias. The current implementation ignores the alias. Credit for this work is attributed to @edgardmessias The original work fixed the bug, but was lacking test. PR Close #27959 PR Close #28904
This commit is contained in:
@ -187,6 +187,27 @@ export class MyComponent {
|
||||
contains('/app/my.component.ts', 'tree', 'children');
|
||||
});
|
||||
|
||||
it('should work with input and output', () => {
|
||||
addCode(
|
||||
`
|
||||
@Component({
|
||||
selector: 'foo-component',
|
||||
template: \`
|
||||
<div string-model ~{stringMarker}="text"></div>
|
||||
<div number-model ~{numberMarker}="value"></div>
|
||||
\`,
|
||||
})
|
||||
export class FooComponent {
|
||||
text: string;
|
||||
value: number;
|
||||
}
|
||||
`,
|
||||
(fileName) => {
|
||||
contains(fileName, 'stringMarker', '[model]', '(model)');
|
||||
contains(fileName, 'numberMarker', '[inputAlias]', '(outputAlias)');
|
||||
});
|
||||
});
|
||||
|
||||
function addCode(code: string, cb: (fileName: string, content?: string) => void) {
|
||||
const fileName = '/app/app.component.ts';
|
||||
const originalContent = mockHost.getFileContent(fileName);
|
||||
|
Reference in New Issue
Block a user