vcs: do not show compile errors in "Open Repository Version" files

follow-up: 8bb4554489
This commit is contained in:
Aleksey Pivovarov
2017-07-13 17:58:10 +03:00
committed by Aleksey Pivovarov
parent 1359b56a35
commit 257f161ef0
2 changed files with 12 additions and 1 deletions
@@ -29,6 +29,14 @@ import com.intellij.psi.PsiFile;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;
/**
* We want to highlight some files, that do not belong to the project (ex: previous revisions from VCS).
* To do so we need some context - SDK, the rest of the project, etc.
* We can't get "real" context, but local state is often a good enough approximation.
* <p>
* This helper is used to disable error highlighting and inspections in such files,
* as they tend to be false-positive due to context differences.
*/
public class OutsidersPsiFileSupport {
public static final Key<Boolean> KEY = Key.create("OutsidersPsiFileSupport");
@@ -1,5 +1,5 @@
/*
* Copyright 2000-2014 JetBrains s.r.o.
* Copyright 2000-2017 JetBrains s.r.o.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -15,6 +15,7 @@
*/
package com.intellij.openapi.vcs.vfs;
import com.intellij.codeInsight.daemon.OutsidersPsiFileSupport;
import com.intellij.openapi.application.ApplicationManager;
import com.intellij.openapi.vfs.VfsUtilCore;
import com.intellij.openapi.vfs.VirtualFile;
@@ -42,6 +43,8 @@ public abstract class AbstractVcsVirtualFile extends VirtualFile {
myParent = new VcsVirtualFolder(file.getParent(), this, myFileSystem);
else
myParent = null;
OutsidersPsiFileSupport.markFile(this);
}
@Override