Skip to content

Commit

Permalink
Merged PR 454676: Do not emit index event for TypeDeclaration
Browse files Browse the repository at this point in the history
Do not emit index event for TypeDeclaration
  • Loading branch information
jdneo committed Apr 9, 2019
1 parent fb80cd7 commit b421025
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@
import org.eclipse.jdt.core.dom.SimpleType;
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
import org.eclipse.jdt.core.dom.Type;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.ls.core.internal.JDTUtils;
import org.eclipse.jdt.ls.core.internal.preferences.PreferenceManager;
import org.eclipse.lsp4j.Location;
Expand All @@ -34,7 +33,7 @@ public DefinitionVisitor() {
@Override
public boolean visit(SimpleName node) {
emitDefinition(node.getStartPosition(), node.getLength());
return super.visit(node);
return false;
}

@Override
Expand All @@ -44,12 +43,6 @@ public boolean visit(SingleVariableDeclaration node) {
return false;
}

@Override
public boolean visit(TypeDeclaration node) {
emitDefinition(node.getStartPosition(), node.getLength());
return true;
}

@Override
public boolean visit(SimpleType node) {
emitDefinition(node.getStartPosition(), node.getLength());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,13 @@ public HoverVisitor() {
@Override
public boolean visit(SimpleType type) {
emitHover(type.getStartPosition(), type.getLength());
return super.visit(type);
return false;
}

@Override
public boolean visit(SimpleName node) {
emitHover(node.getStartPosition(), node.getLength());
return super.visit(node);
return false;
}

private void emitHover(int startPosition, int length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,13 @@ public ReferencesVisitor() {
@Override
public boolean visit(SimpleType type) {
emitReferences(type.getStartPosition(), type.getLength());
return super.visit(type);
return false;
}

@Override
public boolean visit(SimpleName node) {
emitReferences(node.getStartPosition(), node.getLength());
return super.visit(node);
return false;
}

public void emitReferences(int startPosition, int length) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.eclipse.jdt.core.dom.SimpleType;
import org.eclipse.jdt.core.dom.SingleVariableDeclaration;
import org.eclipse.jdt.core.dom.Type;
import org.eclipse.jdt.core.dom.TypeDeclaration;
import org.eclipse.jdt.ls.core.internal.JDTUtils;
import org.eclipse.jdt.ls.core.internal.handlers.NavigateToTypeDefinitionHandler;
import org.eclipse.lsp4j.Location;
Expand Down Expand Up @@ -47,12 +46,6 @@ public boolean visit(SingleVariableDeclaration node) {
return false;
}

@Override
public boolean visit(TypeDeclaration node) {
emitTypeDefinition(node.getStartPosition(), node.getLength());
return true;
}

@Override
public boolean visit(SimpleType node) {
emitTypeDefinition(node.getStartPosition(), node.getLength());
Expand Down

0 comments on commit b421025

Please sign in to comment.