From 11d31064e84873516f27381ca008483d26ca7860 Mon Sep 17 00:00:00 2001 From: nsingh Date: Wed, 22 Nov 2017 11:18:28 -0800 Subject: [PATCH] Refactor method in goto symbol dialogue --- .../gotosymbol/dialogs/GotoSymbolDialog.java | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.gotosymbol/src/org/springframework/tooling/ls/eclipse/gotosymbol/dialogs/GotoSymbolDialog.java b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.gotosymbol/src/org/springframework/tooling/ls/eclipse/gotosymbol/dialogs/GotoSymbolDialog.java index 69076c9f4..80c7a51e2 100644 --- a/eclipse-language-servers/org.springframework.tooling.ls.eclipse.gotosymbol/src/org/springframework/tooling/ls/eclipse/gotosymbol/dialogs/GotoSymbolDialog.java +++ b/eclipse-language-servers/org.springframework.tooling.ls.eclipse.gotosymbol/src/org/springframework/tooling/ls/eclipse/gotosymbol/dialogs/GotoSymbolDialog.java @@ -107,7 +107,7 @@ public class GotoSymbolDialog extends PopupDialog { public StyledString getStyledText(Object element) { StyledString s = super.getStyledText(element); if (element instanceof SymbolInformation) { - String locationText = getWorkspacePathLabelText((SymbolInformation) element); + String locationText = getSymbolLocationText((SymbolInformation) element); if (locationText != null) { s.append(locationText, stylers.italic()); } @@ -119,7 +119,7 @@ public class GotoSymbolDialog extends PopupDialog { public String getText(Object element) { String s = super.getText(element); if (element instanceof SymbolInformation) { - String locationText = getWorkspacePathLabelText((SymbolInformation) element); + String locationText = getSymbolLocationText((SymbolInformation) element); if (locationText != null) { s+=locationText; } @@ -133,11 +133,11 @@ public class GotoSymbolDialog extends PopupDialog { super.dispose(); } - protected String getWorkspacePathLabelText(SymbolInformation symbol) { - Optional workspacePath = GotoSymbolDialog.this - .getWorkspaceLocation(symbol); - if (workspacePath.isPresent()) { - return " -- [" + workspacePath.get() + "]"; + protected String getSymbolLocationText(SymbolInformation symbol) { + Optional location = GotoSymbolDialog.this + .getSymbolLocation(symbol); + if (location.isPresent()) { + return " -- [" + location.get() + "]"; } return null; } @@ -249,7 +249,7 @@ public class GotoSymbolDialog extends PopupDialog { list.addDoubleClickListener(e -> performOk(list)); } - private Optional getWorkspaceLocation(SymbolInformation symbolInformation) { + private Optional getSymbolLocation(SymbolInformation symbolInformation) { String val = null; if (!model.fromFileProvider(symbolInformation)) {