Skip to content
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

Extended diagnostics quick fix #44941

Closed
dgp1130 opened this issue Feb 2, 2022 · 10 comments
Closed

Extended diagnostics quick fix #44941

dgp1130 opened this issue Feb 2, 2022 · 10 comments
Labels
area: compiler Issues related to `ngc`, Angular's template compiler area: language-service Issues related to Angular's VS Code language service feature: under consideration Feature request for which voting has completed and the request is now under consideration feature Issue that requests a new feature
Milestone

Comments

@dgp1130
Copy link
Contributor

dgp1130 commented Feb 2, 2022

Which @angular/* package(s) are relevant/releated to the feature request?

compiler-cli, language-service

Description

Extended diagnostics often have a suggestion solution. This is by design, since they are intended to identify specific mistakes often made by developers with clear solutions or best practices. Since these fixes are so mechanical, we should give an easy, automated way to apply them to a diagnostic.

Proposed solution

Extended diagnostics should be able to generate a set of possible "quick fix" transformations which IDE's can use to address the diagnostic. In the case of invalidBananaInBox, we could automate a change like:

<div ([foo])="bar">Hello</div>
<!-- Fixes to... -->
<div [(foo)]="bar">Hello</div>

@danieltre23 came up with a prototype in danieltre23@52f6a7a and was able to demo the feature. It's a relatively small commit so I don't think this is a significant amount of effort. The work here is to define the "quick fix" data type in the compiler, we'll need something custom since we don't want to depend on VSCode / LSP types here (curious how tsc does this?). The language service / VSCode extension will then need to transform the "quick fix" type into VSCode-compatible "code actions", which the IDE can show and apply with a single click.

Alternatives considered

N/A

@dgp1130 dgp1130 added feature Issue that requests a new feature area: language-service Issues related to Angular's VS Code language service area: compiler Issues related to `ngc`, Angular's template compiler labels Feb 2, 2022
@ngbot ngbot bot modified the milestone: Backlog Feb 2, 2022
@angular-robot angular-robot bot added the feature: votes required Feature request which is currently still in the voting phase label Feb 2, 2022
@angular-robot
Copy link
Contributor

angular-robot bot commented Feb 2, 2022

This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list.

You can find more details about the feature request process in our documentation.

@atscott
Copy link
Contributor

atscott commented Feb 3, 2022

For tracking, @danieltre23 had a proof of concept put together to do this:

danieltre23@52f6a7a
danieltre23/vscode-ng-language-service@3ae1b2d

@angular-robot
Copy link
Contributor

angular-robot bot commented Mar 14, 2022

Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.

Find more details about Angular's feature request process in our documentation.

@angular-robot
Copy link
Contributor

angular-robot bot commented Apr 3, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors and removed feature: votes required Feature request which is currently still in the voting phase labels Apr 3, 2022
@JamesHenry
Copy link
Contributor

FYI we intend to deprecate the banana-in-box lint rule once auto-fixing is implemented: angular-eslint/angular-eslint#660

@atscott atscott removed the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Apr 14, 2022
@atscott atscott added this to Inbox in Feature Requests via automation Apr 14, 2022
@atscott
Copy link
Contributor

atscott commented Apr 14, 2022

@JamesHenry Good to know! I've removed the insufficient votes label since I think this is relatively low hanging fruit and really is something we should take on. As a note, we do make use of upvotes on feature requests to gauge community interest and prioritize projects so it's really helpful to hit that thumbs up button on issues :)

atscott added a commit to atscott/vscode-ng-language-service that referenced this issue Apr 14, 2022
atscott added a commit to atscott/angular that referenced this issue Apr 14, 2022
…ostics

language service implementation for angular#44941. A follow-up PR will be
needed in the language server code to support this information.
@angular-robot
Copy link
Contributor

angular-robot bot commented Apr 15, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added feature: votes required Feature request which is currently still in the voting phase feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors and removed feature: votes required Feature request which is currently still in the voting phase labels Apr 15, 2022
@atscott atscott removed the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Apr 15, 2022
@angular-robot
Copy link
Contributor

angular-robot bot commented Apr 16, 2022

Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.

We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.

You can find more details about the feature request process in our documentation.

@angular-robot angular-robot bot added feature: votes required Feature request which is currently still in the voting phase and removed feature: votes required Feature request which is currently still in the voting phase labels Apr 16, 2022
@angular-robot angular-robot bot added the feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors label Apr 16, 2022
@jessicajaniuk jessicajaniuk added feature: under consideration Feature request for which voting has completed and the request is now under consideration and removed feature: insufficient votes Label to add when the not a sufficient number of votes or comments from unique authors labels Jun 6, 2022
@ivanwonder
Copy link
Contributor

ivanwonder commented Sep 9, 2022

@JamesHenry

FYI, I have opened PR #47393 to support fixing the invalid banana in box.

ivanwonder added a commit to ivanwonder/angular that referenced this issue Sep 23, 2022
The Angular compiler will report the invalid banana in box, this code fixes
will try to fix the error and all the same errors in the selected file.

Fixes angular#44941
ivanwonder added a commit to ivanwonder/angular that referenced this issue Sep 23, 2022
The Angular compiler will report the invalid banana in box, this code fixes
will try to fix the error and all the same errors in the selected file.

Fixes angular#44941
@alxhub alxhub closed this as completed in e7ee53c Sep 27, 2022
Feature Requests automation moved this from Inbox to Closed Sep 27, 2022
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Oct 28, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: compiler Issues related to `ngc`, Angular's template compiler area: language-service Issues related to Angular's VS Code language service feature: under consideration Feature request for which voting has completed and the request is now under consideration feature Issue that requests a new feature
Projects
Development

Successfully merging a pull request may close this issue.

5 participants