Skip to content

Commit

Permalink
Merge pull request #1806 from eugene-auduchinok/on_the_fly_optimize
Browse files Browse the repository at this point in the history
Fix exclude paths for non-Golang files
  • Loading branch information
zolotov committed Aug 17, 2015
2 parents 6ac5f73 + dd4ec66 commit c2c0333
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import com.intellij.openapi.options.ShowSettingsUtil;
import com.intellij.openapi.project.Project;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiFile;
import com.intellij.util.Consumer;
import com.intellij.util.containers.ContainerUtil;
import org.jetbrains.annotations.NotNull;
Expand All @@ -37,9 +38,8 @@ public class GoExcludePathLookupActionProvider implements LookupActionProvider {
@Override
public void fillActions(LookupElement element, final Lookup lookup, Consumer<LookupElementAction> consumer) {
PsiElement psiElement = element.getPsiElement();
if (psiElement == null) return;

String importPath = ((GoFile)psiElement.getContainingFile()).getImportPath();
PsiFile file = psiElement != null ? psiElement.getContainingFile() : null;
String importPath = file instanceof GoFile ? ((GoFile)file).getImportPath() : null;
if (importPath != null) {
Project project = psiElement.getProject();
for (String path : getPaths(importPath)) {
Expand Down

0 comments on commit c2c0333

Please sign in to comment.