private @NotNull GlobalSearchScope createScopeByFile(@NotNull VirtualFile key) {
    VirtualFile original = VirtualFileUtil.originalFile(key);
    VirtualFile file = ObjectUtils.notNull(original, key);
    GlobalSearchScope scope = null;
    for (ResolveScopeProvider resolveScopeProvider : ResolveScopeProvider.EP_NAME.getExtensionList()) {
      scope = resolveScopeProvider.getResolveScope(file, myProject);
      if (scope != null) break;
    }
    if (scope == null) scope = getInherentResolveScope(file);
    for (ResolveScopeEnlarger enlarger : ResolveScopeEnlarger.EP_NAME.getExtensionList()) {
      SearchScope extra = enlarger.getAdditionalResolveScope(file, myProject);
      if (extra != null) {
        scope = scope.union(extra);
      }
    }
    if (original != null && !scope.contains(key)) {
      scope = scope.union(GlobalSearchScope.fileScope(myProject, key));
    }
    return scope;
  }
private @NotNull GlobalSearchScope createScopeByFile(@NotNull VirtualFile key)