Merge branch 'daniil/ast-loading-filter-2'
authorDaniil Ovchinnikov <daniil.ovchinnikov@jetbrains.com>
Sat, 31 Mar 2018 12:47:27 +0000 (14:47 +0200)
committerDaniil Ovchinnikov <daniil.ovchinnikov@jetbrains.com>
Sat, 31 Mar 2018 12:47:27 +0000 (14:47 +0200)
# Conflicts:
# platform/util/resources/misc/registry.properties

1  2 
platform/core-impl/src/com/intellij/psi/impl/source/PsiFileImpl.java
platform/util/resources/misc/registry.properties

index 54762436eb4ff248003bad7d6907b8dd2c958eaa,f2778aa1c13cb0f8c7ca62aa801cc8c5a1fbade7..11af141279961dfe0378edf55afc376cf3188664
@@@ -175,17 -175,16 +177,20 @@@ public abstract class PsiFileImpl exten
      return derefTreeElement() != null;
    }
  
 -  @NotNull
 -  private FileElement loadTreeElement() {
 +  protected void assertReadAccessAllowed() {
 +    if (myViewProvider.getVirtualFile() instanceof ReadOnlyLightVirtualFile) return;
      ApplicationManager.getApplication().assertReadAccessAllowed();
 +  }
  
 +  @NotNull
 +  private FileElement loadTreeElement() {
 +    assertReadAccessAllowed();
      final FileViewProvider viewProvider = getViewProvider();
-     if (viewProvider.isPhysical() && myManager.isAssertOnFileLoading(viewProvider.getVirtualFile())) {
-       LOG.error("Access to tree elements not allowed in tests. path='" + viewProvider.getVirtualFile().getPresentableUrl()+"'");
+     if (viewProvider.isPhysical()) {
+       final VirtualFile vFile = viewProvider.getVirtualFile();
+       if (myManager.isAssertOnFileLoading(vFile) || !isTreeLoadingEnabled(vFile)) {
+         LOG.error("Access to tree elements not allowed. path='" + vFile.getPresentableUrl() + "'");
+       }
      }
  
      FileElement treeElement = createFileElement(viewProvider.getContents());
index e94a2da7ab10b0bf107c7488f331f2b6c7e5346b,8dff3ca2047e700444db7e5b73d9de329faa5ba3..c2a3f6d0abac55e8103319a64f15f18aa65cd3f8
@@@ -1453,71 -1275,5 +1453,74 @@@ use.prebuilt.indices.description=Use bu
  kotlin.annotation.injection.enabled=true
  kotlin.annotation.injection.enabled.description=Used in Kotlin to enable java-patterns language injection to annotations parameters
  
- run.anything.bash.login.mode.description=Run anything: execute 'bash' in login mode
 +typescript.compiler.all.settings=false
 +typescript.compiler.all.settings.description=Show all available typescript compiler settings
 +
 +editor.adjust.right.margin=false
 +editor.adjust.right.margin.description=Whether right margin position for each visual line is shifted according to folded regions' and \
 +inlays' widths on that line
 +editor.show.right.margin.in.read.only.files=true
 +editor.show.right.margin.in.read.only.files.description=Show right margin for read only files in editor
 +
 +editor.text.fractional.metrics=false
 +editor.text.fractional.metrics.description=Do not round glyph advances to integer values
 +editor.text.xcode.vertical.spacing=false
 +editor.text.xcode.vertical.description=Enable the same vertical spacing as Xcode editor uses
 +editor.disable.drag.with.right.button=false
 +editor.disable.drag.with.right.button.description=Disable any mouse drag processing in editor with right mouse button pressed
 +
 +idea.invalidate.caches.invalidates.vfs=false
 +idea.invalidate.caches.invalidates.vfs.description=Invalidate caches tries to invalidate everything, including Local History
 +
 +ext.project.data.serializer=auto
 +ext.project.data.serializer.description=select serialization format for external project data
 +
 +editor.keep.completion.hints.longer=false
 +editor.keep.completion.hints.longer.description=Don't remove hints for parameter names added on method call completion until caret moves \
 +to another line
 +editor.keep.completion.hints.even.longer=false
 +editor.keep.completion.hints.even.longer.description=Remove hints for parameter names added on method call completion only when \
 +corresponding method call becomes invisible (due to scrolling or switching to a different file)
 +
 +folding.signature.validation=false
 +folding.signature.validation.description=Validate that signature for a PSI element, for which a folding region is generated, can be used to\
 + find exactly the same PSI element
 +
 +junit4.accept.inner.classes=true
 +junit4.accept.inner.classes.description=If false, inner classes won't be included in search for tests in package
 +try.starting.dumb.mode.where.many.files.changed=true
 +try.starting.dumb.mode.where.many.files.changed.description=Enables automatic start of dumb mode for all opened projects once more than certain number of files is changed
 +
 +animation.disabled.on.remote.desktop=false
 +animation.disabled.on.remote.desktop.description=Allows to stop animation via RDP
 +
 +editor.highlight.foldings=true
 +editor.highlight.foldings.description=Highlight folded regions containing certain highlighters (e.g. for search results)
 +ide.hide.real.module.name=false
 +ide.hide.real.module.name.description=Removes real module name from Project View in square brackets
 +ide.show.folder.name.instead.of.module.name=false
 +ide.show.folder.name.instead.of.module.name.description=Uses module folder name instead of module name in renderers
 +
 +feature.usage.event.log.collect.and.upload=false
 +feature.usage.event.log.collect.and.upload.description=Enables feature usage event log collection and uploads it to the server
 +
 +action.aware.typeAhead=true
 +action.aware.typeAhead.description=Enables action aweare typeahead
 +action.aware.typeaheadTimout=10000
 +action.aware.typeaheadTimout.description=The action aware typeahead is canceled in this amount of time if the typeahead fails.
 +action.aware.typeahead.actions.list=GotoClass,GotoFile,GotoSymbol,FindInPath,ReplaceInPath,FileStructurePopup
 +action.aware.typeahead.actions.list.description=List of actions that may show popups.
 +action.aware.typeAhead.searchEverywhere=false
 +
 +show.new.plugin.page=false
 +show.new.plugin.page.description=Show new plugin page configurable
 +skip.typed.event=true
 +skip.typed.event.description=Skip typed event if focus goes to owner
 +
 +promise.check.write.action=false
 +
 +run.anything.bash.login.mode=true
++run.anything.bash.login.mode.description=Run anything: execute 'bash' in login mode
++
+ ast.loading.filter=false
+ ast.loading.filter.description=Enables the mechanism that disables AST loading in particular thread