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 ignored files when different project path #17

Closed
wants to merge 4 commits into from
Closed

Fix ignored files when different project path #17

wants to merge 4 commits into from

Conversation

dubreuia
Copy link
Owner

No description provided.

@dubreuia
Copy link
Owner Author

@dorkbox I took only commit ae7a25e and modified it a bit : you deleted the method com.dubreuia.Component#isActive(com.intellij.openapi.editor.Document), so I restored it.

I'm wondering if the method isActive duplicates the check you do with DataManager.getInstance().getDataContextFromFocus().getResult() ? Is it why you removed krasa's methods ?

@dorkbox
Copy link
Contributor

dorkbox commented Jul 18, 2015

Yes, it's a duplicate.

@dorkbox
Copy link
Contributor

dorkbox commented Jul 18, 2015

I forgot to push my latest -- as there are issues with not having a document selected and null pointers.

@dorkbox
Copy link
Contributor

dorkbox commented Jul 18, 2015

I think that I've also found a better method to check which is the active document -- it turns out that if something else has focus, it won't run the save actions, and there are some null pointers floating around . I think the "Fast Scroll" plugin behaves the way we want -- where the currently selected document is the one modified. I'm looking into that right now

@dubreuia
Copy link
Owner Author

I merged 7d8b75 in master. Keep me posted if you find a better solution.

@dorkbox
Copy link
Contributor

dorkbox commented Jul 19, 2015

It turns out that the Fast Scroll plugin uses similar hooks as Save Actions does.

I should point out that DataManager.getInstance().getDataContextFromFocus().getResult() is the recommend way to get the active context, from jetbrains staff -- I found it while reading their forums. Then from there we can get the correct project and document in a straightforward way.

@dubreuia
Copy link
Owner Author

OK I'm closing the PR as this is our current implementation.

And I tested this morning, krasa's isActive method is needed too so that the plugin executes on frame deactivation too. If it not there it will always skip the plugin, except on the Save All action, which is not what we want.

You might want to check the current master, it is quite far from yours.

@dubreuia dubreuia closed this Jul 19, 2015
@dorkbox
Copy link
Contributor

dorkbox commented Jul 19, 2015

Ah, excellent point about isActive, I didn't try that. Now that the issues I was having are fixed (even though my master has drifted far from yours), I'll be dropping my fork and switching back. Thanks for merging the fixes. 👍 Now to figure out how to add missing @Override annotations on save action...

@dubreuia
Copy link
Owner Author

"Now to figure out how to add missing @OverRide annotations on save action..."

About that, I was thinking of supporting any inspections. See #9, there is some code in there too.

@dorkbox
Copy link
Contributor

dorkbox commented Jul 20, 2015

Great! I'll submit a PR for you when I get that added. On the topic of inspections, adding the this. prefix is also one that I would want.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants