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

git exclude file from another project is shown in 'Outer ignore rules' #460

Closed
2 of 3 tasks
pavelrad opened this issue Aug 28, 2017 · 4 comments
Closed
2 of 3 tasks

Comments

@pavelrad
Copy link

Prerequisites

  • Plugin is in the latest version
  • Issue was not reported yet
  • Stack trace (if provided) contains mobi.hsz.idea.gitignore package name

Description

When .gitignore file for the current project is opened in the editor, git 'exclude' files from another project and its submodules are shown in the 'Outer ignore rules' pane next to the .gitignore_global file.

Steps to Reproduce

  1. Invalidate IDE cache.
  2. Open some project with a git repo initialized and containing .gitignore and .git/info/exclude files.
  3. Open the .gitignore file in the editor.
  4. Close that project.
  5. Open another project with the similar stuff.
  6. Open the .gitignore file in the editor.

Expected behavior: 'Outer ignore rules' shows ~/.gitignore_global and 'exclude' files from the current project's repo.

Actual behavior: 'Outer ignore rules' shows ~/.gitignore_global and 'exclude' files from the project, that was opened before (first_project/.git/info/exclude and first_project/.git/modules/submodule_name/info/exclude).

Reproduces how often: Each time.

Versions

Plugin: 2.1.1.

IDE: PyCharm CE 2017.2.2.

OS: OS X 10.10.5.

@hsz hsz added the bug label Aug 28, 2017
@hsz hsz added this to the v2.1.2 milestone Sep 3, 2017
@hsz
Copy link
Member

hsz commented Sep 3, 2017

Fix is available in v2.2.0-RC2 in EAP channel.

@pavelrad
Copy link
Author

pavelrad commented Sep 4, 2017

v2.2.0-RC4 causes the following error in PyCharm CE 2017.2.2:

@NotNull method mobi/hsz/idea/gitignore/lang/kind/GitLanguage.getOuterFiles must not return null
java.lang.IllegalStateException: @NotNull method mobi/hsz/idea/gitignore/lang/kind/GitLanguage.getOuterFiles must not return null
	at mobi.hsz.idea.gitignore.lang.kind.GitLanguage.$$$reportNull$$$0(GitLanguage.java)
	at mobi.hsz.idea.gitignore.lang.kind.GitLanguage.getOuterFiles(GitLanguage.java:117)
	at mobi.hsz.idea.gitignore.psi.IgnoreFile.isOuter(IgnoreFile.java:155)
	at mobi.hsz.idea.gitignore.reference.IgnoreReferenceSet$IgnoreReference.isOuterFile(IgnoreReferenceSet.java:287)
	at mobi.hsz.idea.gitignore.reference.IgnoreReferenceSet$IgnoreReference.innerResolveInContext(IgnoreReferenceSet.java:210)
	at com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference.innerResolve(FileReference.java:146)
	at com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference$MyResolver.resolve(FileReference.java:591)
	at com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference$MyResolver.resolve(FileReference.java:585)
	at com.intellij.psi.impl.source.resolve.ResolveCache.resolveWithCaching(ResolveCache.java:188)
	at com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference.multiResolve(FileReference.java:134)
	at com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference.resolve(FileReference.java:360)
	at com.intellij.psi.impl.source.resolve.reference.impl.providers.FileReference.resolve(FileReference.java:58)
	at com.intellij.codeInsight.TargetElementUtil.doGetReferenceOrReferencedElement(TargetElementUtil.java:389)
	at com.intellij.codeInsight.TargetElementUtil.getReferenceOrReferencedElement(TargetElementUtil.java:366)
	at com.intellij.codeInsight.TargetElementUtil.doFindTargetElement(TargetElementUtil.java:236)
	at com.intellij.codeInsight.TargetElementUtil.findTargetElement(TargetElementUtil.java:208)
	at com.intellij.codeInsight.daemon.impl.IdentifierHighlighterPass.doCollectInformation(IdentifierHighlighterPass.java:92)
	at com.intellij.codeHighlighting.TextEditorHighlightingPass.collectInformation(TextEditorHighlightingPass.java:70)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$null$1(PassExecutorService.java:438)
	at com.intellij.openapi.application.impl.ApplicationImpl.tryRunReadAction(ApplicationImpl.java:1161)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$doRun$2(PassExecutorService.java:431)
	at com.intellij.openapi.progress.impl.CoreProgressManager.registerIndicatorAndRun(CoreProgressManager.java:548)
	at com.intellij.openapi.progress.impl.CoreProgressManager.executeProcessUnderProgress(CoreProgressManager.java:493)
	at com.intellij.openapi.progress.impl.ProgressManagerImpl.executeProcessUnderProgress(ProgressManagerImpl.java:94)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.doRun(PassExecutorService.java:430)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.lambda$run$0(PassExecutorService.java:406)
	at com.intellij.openapi.application.impl.ReadMostlyRWLock.executeByImpatientReader(ReadMostlyRWLock.java:142)
	at com.intellij.openapi.application.impl.ApplicationImpl.executeByImpatientReader(ApplicationImpl.java:250)
	at com.intellij.codeInsight.daemon.impl.PassExecutorService$ScheduledPass.run(PassExecutorService.java:404)
	at com.intellij.concurrency.JobLauncherImpl$VoidForkJoinTask$1.exec(JobLauncherImpl.java:165)
	at java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:289)
	at java.util.concurrent.ForkJoinPool$WorkQueue.runTask(ForkJoinPool.java:1056)
	at java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1692)
	at java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:157)

@hsz
Copy link
Member

hsz commented Sep 4, 2017

@pavelrad God... It should never happens. I bet some Java threads synchronization issue. Thank you very much - RC5 is released.

@pavelrad
Copy link
Author

pavelrad commented Sep 4, 2017

Looks like the problem is not fixed. Got these two errors:
@NotNull method mobi/hsz/idea/gitignore/lang/IgnoreLanguage.getOuterFiles must not return null
@NotNull method mobi/hsz/idea/gitignore/lang/kind/GitLanguage.getOuterFiles must not return null

@hsz hsz closed this as completed Sep 4, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants