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

Module in a different path than project won't work #13

Closed
dorkbox opened this issue Jun 19, 2015 · 7 comments
Closed

Module in a different path than project won't work #13

dorkbox opened this issue Jun 19, 2015 · 7 comments
Assignees
Labels

Comments

@dorkbox
Copy link
Contributor

dorkbox commented Jun 19, 2015

This is related to the fix for #1, because if you have a module whose code is in a different system path than the project -- the plugin won't work at all.

This is fixed (and tested against #1 also) by using

// only process the project that is currently active
final DataContext dataContext = DataManager.getInstance().getDataContextFromFocus().getResult();
final Project project = DataKeys.PROJECT.getData(dataContext);
final PsiFile psiFile = PsiDocumentManager.getInstance(project).getPsiFile(document);

And removing "isActive" and "isPsiFilePhysicallyInProject".

This commit has the fix + the "only modify if saveAll command is issued" fix from @krasa as well. I would do a PR, but there are some other changes as well that you might not want.

@dubreuia
Copy link
Owner

Thanks @dorkbox, I'll check your commit this weekend and close the bug if OK

@dubreuia
Copy link
Owner

See PR : #17, I not sure if we still need isActive or not...

@dubreuia dubreuia added the bug label Jul 18, 2015
@dubreuia dubreuia self-assigned this Jul 18, 2015
@dubreuia
Copy link
Owner

Merged

@dubreuia
Copy link
Owner

I have a regression on #1, I'm reopening this issue.

@dubreuia dubreuia reopened this Jul 19, 2015
@dorkbox
Copy link
Contributor Author

dorkbox commented Jul 19, 2015

Strange - the dataContext method should have prevented #1

@dubreuia
Copy link
Owner

Actually dataContext works as expected, the problem is that Intellij doesn't trigger file sync when you change between two editor instances, so that case do not work:

  • Edit a file in editor1
  • Edit a file in editor2
  • Lose focus for Intellij
  • Check dataContext return editor2 (last focus...), but the file sync will trigger for the files in editor1 too

I reverted the changes in master.

@dubreuia
Copy link
Owner

dubreuia commented Feb 8, 2016

Corrected in 0.5

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

No branches or pull requests

2 participants