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

fix(server): filter unsupported code action #1834

Merged
merged 1 commit into from
Dec 8, 2022

Conversation

ivanwonder
Copy link
Contributor

Now the Angular code action provider only supports QuickFix. If leave the codeActionKinds empty, all action requests will be sent to the Angular language service, especially for the action before saving the file, the Angular code action provider will try to fix all errors in the whole file, it's expensive.

Fixes #1828

Copy link
Collaborator

@atscott atscott left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for fixing this! We definitely didn't have the historical context to know about this option.

@dylhunn
Copy link
Collaborator

dylhunn commented Dec 7, 2022

Thanks Ivan. This would have been really hard to figure out!

Now the Angular code action provider only supports `QuickFix`. If leave the
`codeActionKinds` empty, all action requests will be sent to the Angular language
service, especially for the action before saving the file, the Angular code action
provider will try to fix all errors in the whole file, it's expensive.

Fixes angular#1828
@ivanwonder
Copy link
Contributor Author

BTW, the user also can send the quick fix action before saving, but I think it's not expected.

For example, In the built-in typescript extension.

"editor.codeActionsOnSave": {
  "quickfix": true,
}
class Test {
    test() {
        this.missingMember
    }
}

After the user saves the file.

class Test {
    [x: string]: any;
    missingMember: any;
    test() {
        this.missingMember
    }
}

@atscott atscott added target: patch This PR is targeted for the next patch release action: merge Ready to merge labels Dec 8, 2022
@atscott atscott merged commit 38729c9 into angular:main Dec 8, 2022
atscott pushed a commit that referenced this pull request Dec 8, 2022
Now the Angular code action provider only supports `QuickFix`. If leave the
`codeActionKinds` empty, all action requests will be sent to the Angular language
service, especially for the action before saving the file, the Angular code action
provider will try to fix all errors in the whole file, it's expensive.

Fixes #1828

(cherry picked from commit 38729c9)
@ivanwonder ivanwonder deleted the fix-code-action-before-saving branch December 9, 2022 06:13
@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 Jan 9, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
action: merge Ready to merge target: patch This PR is targeted for the next patch release
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Performance weak. I see the »Getting code actions from …« message almost always
3 participants