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:
Keen Yee Liau
2019-01-30 10:34:36 -08:00
committed by Ben Lesh
parent 43181ea568
commit ad4a9bf03f
3 changed files with 32 additions and 4 deletions

View File

@ -173,8 +173,9 @@ function getAttributeInfosForElement(
matcher.match(elementSelector, selector => {
let directive = selectorMap.get(selector);
if (directive) {
attrs.push(...Object.keys(directive.inputs).map(name => ({name, input: true})));
attrs.push(...Object.keys(directive.outputs).map(name => ({name, output: true})));
const {inputs, outputs} = directive;
attrs.push(...Object.keys(inputs).map(name => ({name: inputs[name], input: true})));
attrs.push(...Object.keys(outputs).map(name => ({name: outputs[name], output: true})));
}
});