-
Notifications
You must be signed in to change notification settings - Fork 26.4k
feat(language-service): support to fix missing required inputs diagno… #50911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
aa9d62a
to
f0c16b0
Compare
@ivanwonder Sorry for the long wait on getting this looked at. If you're still willing to get this landed, can you rebase and resolve the conflicts. It looks like a nice feature to get landed. |
f0c16b0
to
b5f7c12
Compare
Actually, nevermind on the rebase. I was able to resolve those for you. |
de4f346
to
8360b43
Compare
@ivanwonder Yeah, looks like even with resolving the conflicts, this is broken. Can you take a look? |
OK, I'll take a look. |
@thePunderWoman Done. It seems that the |
06b6bd1
to
efc2a14
Compare
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
9200747
to
67763fb
Compare
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
67763fb
to
d6b93fc
Compare
…stic Support to add the missing required inputs into the element and append after the last attribute of the element. But it skips the structural directive shorthand attribute. For example, `<a *ngFor=""></a>`, its shorthand is `<ng-template ngFor>`, the `valueSpan` of the `ngFor` is empty, and the info is lost, so it can't use to insert the missing attribute after it.
d6b93fc
to
618020b
Compare
/** | ||
* If the input is a decorator, return the type of the symbol; if there is a | ||
* transform for the input, return the transform type. | ||
* | ||
* If the input is a signal, the real input type is wrapped by the signal type. | ||
*/ | ||
function getInputType( | ||
symbol: ts.Symbol, | ||
typeCheck: ts.TypeChecker, | ||
isSignal: boolean, | ||
transformTypeNode: ts.TypeNode | undefined, | ||
): ts.Type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I forgot to support the input transform and the signal type.
@atscott This needs to be reviewed again.
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
packages/language-service/src/codefixes/fix_missing_required_inputs.ts
Outdated
Show resolved
Hide resolved
This PR was merged into the repository by commit 5d2e859. The changes were merged into the following branches: main |
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
…stic
Support to add the missing required inputs into the element and append after the last attribute of the element.
But it skips the structural directive shorthand attribute. For example,
<a *ngFor=""></a>
, its shorthand is<ng-template ngFor>
, thevalueSpan
of thengFor
is empty, and the info is lost, so it can't use to insert the missing attribute after it.PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
What is the current behavior?
Issue Number: N/A
What is the new behavior?
Does this PR introduce a breaking change?
Other information