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

INSP: Auto import quick fix #2338

Merged
merged 7 commits into from Mar 1, 2018

Conversation

Projects
None yet
2 participants
@Undin
Copy link
Member

Undin commented Mar 1, 2018

Finally, it works 🎉
screen shot 2018-03-01 at 03 12 52

  • convert auto import intention into quick fix for RsUnresolvedReferenceInspection
  • enable by default RsUnresolvedReferenceInspection
  • add option to ignore unresolved references without quick fix

Closes #1366
Closes #2034

@Undin

This comment has been minimized.

Copy link
Member

Undin commented Mar 1, 2018


override fun createOptionsPanel(): JComponent {
val panel = MultipleCheckboxOptionsPanel(this)

This comment has been minimized.

@matklad

matklad Mar 1, 2018

Member

MultipleCheckboxOptionsPanel(this).apply { addCheckBox } ?


class AutoImportFix(path: RsPath) : LocalQuickFixOnPsiElement(path), HighPriorityAction {

private var isConsumed: Boolean = false

This comment has been minimized.

@matklad

matklad Mar 1, 2018

Member

This bit of mutable state looks suspicious... Is this pattern used in other extensions?

This comment has been minimized.

@Undin

Undin Mar 1, 2018

Member

This bit of mutable state looks suspicious...

I don't like it too but without it, we can get the following situation after successful auto import application
screen shot 2018-03-01 at 11 16 23
I don't know if it is bug or feature but looks like that platform tries to check availability of HintAction after its application

Is this pattern used in other extensions?

Python AutoImportQuickFix uses the same approach

@Undin Undin force-pushed the auto-import-quick-fix branch from 245199e to cc9fb2e Mar 1, 2018

@Undin Undin force-pushed the auto-import-quick-fix branch from cc9fb2e to 3f37a92 Mar 1, 2018

@Undin

This comment has been minimized.

Copy link
Member

Undin commented Mar 1, 2018

@matklad other comments?

@matklad

This comment has been minimized.

Copy link
Member

matklad commented Mar 1, 2018

@Undin I don't have time for a thorough review at the moment, but all in all it looks great, and I can't wait to try the nightly build with this feature, so, let's r+ and ask @vlad20012 to scrutinize this after the merge? :-)

@Undin

This comment has been minimized.

Copy link
Member

Undin commented Mar 1, 2018

bors r=matklad

bors bot added a commit that referenced this pull request Mar 1, 2018

Merge #2338
2338: INSP: Auto import quick fix r=matklad a=Undin

Finally, it works 🎉
<img width="230" alt="screen shot 2018-03-01 at 03 12 52" src="https://user-images.githubusercontent.com/2539310/36820347-7a13eeb0-1cfe-11e8-99a9-e9c6899cb765.png">

* convert auto import intention into quick fix for `RsUnresolvedReferenceInspection`
* enable by default `RsUnresolvedReferenceInspection`
* add option to ignore unresolved references without quick fix

Closes #1366
Closes #2034
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Mar 1, 2018

@Undin

This comment has been minimized.

Copy link
Member

Undin commented Mar 1, 2018

bors r=matklad

bors bot added a commit that referenced this pull request Mar 1, 2018

Merge #2338
2338: INSP: Auto import quick fix r=matklad a=Undin

Finally, it works 🎉
<img width="230" alt="screen shot 2018-03-01 at 03 12 52" src="https://user-images.githubusercontent.com/2539310/36820347-7a13eeb0-1cfe-11e8-99a9-e9c6899cb765.png">

* convert auto import intention into quick fix for `RsUnresolvedReferenceInspection`
* enable by default `RsUnresolvedReferenceInspection`
* add option to ignore unresolved references without quick fix

Closes #1366
Closes #2034
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Mar 1, 2018

@Undin

This comment has been minimized.

Copy link
Member

Undin commented Mar 1, 2018

bors r=matklad

bors bot added a commit that referenced this pull request Mar 1, 2018

Merge #2338
2338: INSP: Auto import quick fix r=matklad a=Undin

Finally, it works 🎉
<img width="230" alt="screen shot 2018-03-01 at 03 12 52" src="https://user-images.githubusercontent.com/2539310/36820347-7a13eeb0-1cfe-11e8-99a9-e9c6899cb765.png">

* convert auto import intention into quick fix for `RsUnresolvedReferenceInspection`
* enable by default `RsUnresolvedReferenceInspection`
* add option to ignore unresolved references without quick fix

Closes #1366
Closes #2034
@bors

This comment has been minimized.

Copy link
Contributor

bors bot commented Mar 1, 2018

@bors bors bot merged commit 3f37a92 into master Mar 1, 2018

2 checks passed

bors Build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@bors bors bot deleted the auto-import-quick-fix branch Mar 1, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment