Turn of scanning in Intellij 15

Hi All,

Is there a way to progrmatically turn of external file change (roots and file changes) scanning in Intelllij (via a plugin)/ some setting already present ? I found this setting "File sync on Frame Activation" which can be used for turning of external file scans on frame activation. But would this turn off all external file scans regardless of when the frame is active? I was looking to turn of scanning during a heavy process (not relevant to Intellij particularly, for example a project build) which might result in triggering too many file change events (also causing intellij to reindex). Would appreciate any tips or suggestions.

Thanks
-Harani

5 comments
Comment actions Permalink

SaveAndSyncHandler.blockSyncOnFrameActivation() - please do not abuse and don't forget to unblock.

Normally, IDEA does not scan disks much - besides frame activation, it looks for file changes only when they are anticipated (e.g. after VCS operations). If you have noticed an excessive scanning, it may be a bug.

0
Comment actions Permalink

Thanks for the quick response :), I understand that. Would you know what other scenarios would lead to scans, other than frame activation and VCS changes?. I am using the latest Intellij 15 release and see frequent logs for scanning and indexing as follows. This is more prominent but not limited to an ongoing build. - http://blog.jetbrains.com/idea/2015/11/intellij-idea-15-released-adds-kotlin-to-the-family-of-supported-jvm-languages/

Logs:
2015-11-10 14:21:19,940 [ 794508]  DEBUG - tellij.psi.impl.PsiManagerImpl - propertyChanged: element = null, propertyName = roots, oldValue = [Lcom.intellij.openapi.vfs.VirtualFile;@6a658488, newValue = [Lcom.intellij.openapi.vfs.VirtualFile;@729b3da9
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeUi.addSubtreeToUpdate: two: started
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeUi.addSubtreeToUpdate: two: finished
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeUi.invokeLaterIfNeeded: started
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeBuilder.queueUpdateFrom: started
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeUi.addSubtreeToUpdate: two: started
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeUi.addSubtreeToUpdate: two: finished
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeBuilder.queueUpdateFrom: finished
2015-11-10 14:21:19,940 [ 794508]  DEBUG - lij.openapi.util.NamedRunnable - AbstractTreeUi.invokeLaterIfNeeded: finished
2015-11-10 14:21:19,965 [ 794533]  DEBUG - ntellij.util.proxy.CommonProxy - CommonProxy.select called for xxxxx...
2015-11-10 14:21:19,965 [ 794533]  DEBUG - util.net.IdeaWideProxySelector - IDEA-wide proxy selector asked for xxx...
2015-11-10 14:21:19,965 [ 794533]  DEBUG - ntellij.util.proxy.CommonProxy - CommonProxy.select returns custom proxy for xxx...., [DIRECT]
2015-11-10 14:21:20,008 [ 794576]  DEBUG - ight.daemon.impl.FileStatusMap - Mark all dirty: PsiTreeChangeEventImpl{PROPERTY_CHANGED (roots)}
2015-11-10 14:21:20,009 [ 794577]  DEBUG - aemon.impl.PassExecutorService -  null Cancel Write action finish true ; progress=null ? : ''
2015-11-10 14:21:20,009 [ 794577]  DEBUG - ight.daemon.impl.FileStatusMap - Mark all dirty: Global restart
2015-11-10 14:21:20,009 [ 794577]  DEBUG - aemon.impl.PassExecutorService -  null Cancel Global restart true ; progress=null ? : ''
2015-11-10 14:21:20,009 [ 794577]   INFO - s.impl.ProjectManagerComponent - project roots have changed
2015-11-10 14:21:20,011 [ 794579]  DEBUG - penapi.project.DumbServiceImpl - Scheduling task com.intellij.util.indexing.UnindexedFilesUpdater@7da028c4
java.lang.Throwable
 at com.intellij.openapi.project.DumbServiceImpl.scheduleCacheUpdate(DumbServiceImpl.java:160)
 at com.intellij.openapi.project.DumbServiceImpl.queueTask(DumbServiceImpl.java:85)
 at com.intellij.openapi.roots.impl.ProjectRootManagerComponent.doSynchronizeRoots(ProjectRootManagerComponent.java:298)
 at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.fireRootsChanged(ProjectRootManagerImpl.java:421)
 at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.access$100(ProjectRootManagerImpl.java:57)
 at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.fireChange(ProjectRootManagerImpl.java:114)
 at com.intellij.openapi.roots.impl.ProjectRootManagerImpl$BatchSession.rootsChanged(ProjectRootManagerImpl.java:127)
 at com.intellij.openapi.roots.impl.ProjectRootManagerImpl.makeRootsChange(ProjectRootManagerImpl.java:359)
 at com.intellij.openapi.module.impl.ModuleManagerImpl.commitModel(ModuleManagerImpl.java:951)
 at com.intellij.openapi.module.impl.ModuleManagerImpl.access$1800(ModuleManagerImpl.java:73)
 at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.commitWithRunnable(ModuleManagerImpl.java:857)
 at com.intellij.openapi.module.impl.ModuleManagerImpl$ModuleModelImpl.access$1600(ModuleManagerImpl.java:619)
 at com.intellij.openapi.module.impl.ModuleManagerImpl.commitModelWithRunnable(ModuleManagerImpl.java:610)
 at com.intellij.openapi.roots.impl.ModifiableModelCommitter.multiCommit(ModifiableModelCommitter.java:48)
 at com.intellij.openapi.roots.impl.ModifiableModelCommitter.multiCommit(ModifiableModelCommitter.java:37)
 at com.intellij.openapi.roots.impl.ModuleRootManagerImpl.commitModel(ModuleRootManagerImpl.java:178)
 at com.intellij.openapi.roots.impl.RootModelImpl.commit(RootModelImpl.java:338)
 at com.intellij.openapi.roots.PlatformModifiableModelsProvider.commitModuleModifiableModel(PlatformModifiableModelsProvider.java:23)
 at com.intellij.framework.detection.impl.FacetBasedDetectedFrameworkDescription.doSetup(FacetBasedDetectedFrameworkDescription.java:120)
 at com.intellij.framework.detection.impl.FacetBasedDetectedFrameworkDescriptionImpl.setupFramework(FacetBasedDetectedFrameworkDescriptionImpl.java:53)
 at com.intellij.framework.detection.impl.FrameworkDetectionUtil.setupFrameworks(FrameworkDetectionUtil.java:104)
 at com.intellij.framework.detection.impl.FrameworkDetectionManager.showSetupFrameworksDialog(FrameworkDetectionManager.java:258)
 at com.intellij.framework.detection.impl.FrameworkDetectionManager.access$500(FrameworkDetectionManager.java:59)
 at com.intellij.framework.detection.impl.FrameworkDetectionManager$4.hyperlinkUpdate(FrameworkDetectionManager.java:200)
 at com.intellij.notification.EventLog$NotificationHyperlinkInfo.navigate(EventLog.java:466)
 at com.intellij.execution.impl.EditorHyperlinkSupport$3.run(EditorHyperlinkSupport.java:143)
 at com.intellij.execution.impl.EditorHyperlinkSupport$1.mouseClicked(EditorHyperlinkSupport.java:83)
 at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.runMouseClickedCommand(EditorImpl.java:5802)
 at com.intellij.openapi.editor.impl.EditorImpl$MyMouseAdapter.mouseReleased(EditorImpl.java:5729)
 at java.awt.Component.processMouseEvent(Component.java:6535)
 at javax.swing.JComponent.processMouseEvent(JComponent.java:3324)
 at java.awt.Component.processEvent(Component.java:6300)
 at java.awt.Container.processEvent(Container.java:2236)
 at java.awt.Component.dispatchEventImpl(Component.java:4891)
 at java.awt.Container.dispatchEventImpl(Container.java:2294)
 at java.awt.Component.dispatchEvent(Component.java:4713)
 at java.awt.LightweightDispatcher.retargetMouseEvent(Container.java:4888)
 at java.awt.LightweightDispatcher.processMouseEvent(Container.java:4525)
 at java.awt.LightweightDispatcher.dispatchEvent(Container.java:4466)
 at java.awt.Container.dispatchEventImpl(Container.java:2280)
 at java.awt.Window.dispatchEventImpl(Window.java:2750)
 at java.awt.Component.dispatchEvent(Component.java:4713)
 at java.awt.EventQueue.dispatchEventImpl(EventQueue.java:758)
 at java.awt.EventQueue.access$500(EventQueue.java:97)
 at java.awt.EventQueue$3.run(EventQueue.java:709)
 at java.awt.EventQueue$3.run(EventQueue.java:703)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:86)
 at java.awt.EventQueue$4.run(EventQueue.java:731)
 at java.awt.EventQueue$4.run(EventQueue.java:729)
 at java.security.AccessController.doPrivileged(Native Method)
 at java.security.ProtectionDomain$JavaSecurityAccessImpl.doIntersectionPrivilege(ProtectionDomain.java:76)
 at java.awt.EventQueue.dispatchEvent(EventQueue.java:728)
 at com.intellij.ide.IdeEventQueue.defaultDispatchEvent(IdeEventQueue.java:861)
 at com.intellij.ide.IdeEventQueue._dispatchEvent(IdeEventQueue.java:645)
 at com.intellij.ide.IdeEventQueue.dispatchEvent(IdeEventQueue.java:380)
 at java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:201)
 at java.awt.EventDispatchThread.pumpEventsForFilter(EventDispatchThread.java:116)
 at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:105)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:101)
 at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:93)
 at java.awt.EventDispatchThread.run(EventDispatchThread.java:82)

Thanks
-Harani.

0
Comment actions Permalink

An indexing like the one from the stacktrace happen when a structure of a project is changed - in your case a new facet was added.

0
Comment actions Permalink

Can you help me with listing all the scenarios leading to a scan and best way to turn it off. Following are a few places I found this-
1. Turning off File Watcher
2. RefreshSession/RefreshQueue - how can we stop this?
3. ProjectRootManager

0
Comment actions Permalink

Um... what's your end goal?

You see, indices are the core of all IDEA functionality, and it is crucial to keep them up to date. If their update is hindered, you may just throw the whole IDE out of a window and use a plain text editor instead.

0

Please sign in to leave a comment.