Skip to content
This repository has been archived by the owner on Oct 5, 2021. It is now read-only.

Commit

Permalink
Merge pull request #241 from Shan1024/completion-fix
Browse files Browse the repository at this point in the history
Fix issues in code completion
  • Loading branch information
sameerajayasoma authored Apr 18, 2017
2 parents ddccad9 + 2ffbd14 commit 0b87404
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
import com.intellij.icons.AllIcons;
import com.intellij.openapi.project.DumbAware;
import com.intellij.patterns.PlatformPatterns;
import com.intellij.psi.PsiComment;
import com.intellij.psi.PsiDirectory;
import com.intellij.psi.PsiElement;
import com.intellij.psi.PsiErrorElement;
Expand Down Expand Up @@ -668,7 +669,7 @@ private void addSuggestions(CompletionParameters parameters, CompletionResultSet
// Todo - Handle scenario
} else {
// If we are currently at an identifier node, no need to suggest.
if (element instanceof IdentifierPSINode) {
if (element instanceof IdentifierPSINode || element instanceof PsiComment) {
return;
}
if (parentPrevSibling == null) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -665,6 +665,9 @@ public static ArrayList<PsiElement> getAllImportedPackagesInCurrentFile(PsiEleme
* @return all functions in the given directory(package)
*/
public static List<PsiElement> getAllMatchingElementsFromPackage(PsiDirectory directory, String xpath) {
if (directory == null) {
return new LinkedList<>();
}
Project project = directory.getProject();
List<PsiElement> results = new ArrayList<>();
VirtualFile virtualFile = directory.getVirtualFile();
Expand Down

0 comments on commit 0b87404

Please sign in to comment.