Skip to content

Extended diagnostics quick fix #44941

Closed
Closed

Description

@dgp1130

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

Activity

  1. added
    feature
    area: language-service
    area: compiler
    on Feb 2, 2022
  2. modified the milestone: Backlog on Feb 2, 2022
  3. angular-robot commented on Feb 2, 2022

    @angular-robot
    Contributor

    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.

  4. atscott commented on Feb 3, 2022

    @atscott
    Contributor

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

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

  5. angular-robot commented on Mar 14, 2022

    @angular-robot
    Contributor

    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.

  6. angular-robot commented on Apr 3, 2022

    @angular-robot
    Contributor

    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.

  7. JamesHenry commented on Apr 14, 2022

    @JamesHenry
    Contributor

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

  8. 6 remaining items

  9. angular-robot commented on Apr 16, 2022

    @angular-robot
    Contributor

    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.

  10. added
    feature: under consideration
    and removed on Jun 6, 2022
  11. ivanwonder commented on Sep 9, 2022

    @ivanwonder
    Contributor

    @JamesHenry

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

  12. angular-automatic-lock-bot commented on Oct 28, 2022

    @angular-automatic-lock-bot

    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.

  13. locked and limited conversation to collaborators on Oct 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: compilerarea: language-servicefeaturefeature: under consideration

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions