package nl.rubensten.texifyidea.structure;

import com.intellij.navigation.ItemPresentation;
import nl.rubensten.texifyidea.psi.LatexCommands;
import nl.rubensten.texifyidea.util.TexifyUtil;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * @author Ruben Schellekens
 */
public class LatexOtherCommandPresentation implements ItemPresentation {

    private final String commandName;
    private final Icon icon;
    private final String locationString;

    public LatexOtherCommandPresentation(LatexCommands command, Icon icon) {
        this.commandName = command.getName();
        this.icon = icon;

        LatexCommands firstNext = TexifyUtil.getNextCommand(command);
        if (firstNext == null) {
            locationString = "";
            return;
        }

        String lookup = firstNext.getCommandToken().getText();
        this.locationString = lookup == null ? "" : lookup;
    }

    @Nullable
    @Override
    public String getPresentableText() {
        return commandName;
    }

    @Nullable
    @Override
    public String getLocationString() {
        return locationString;
    }

    @Nullable
    @Override
    public Icon getIcon(boolean b) {
        return icon;
    }
}

package nl.rubensten.texifyidea.structure;

import nl.rubensten.texifyidea.psi.LatexCommands;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import javax.swing.*;

/**
 * @author Ruben Schellekens
 */
public class LatexOtherCommandPresentation implements EditableHintPresentation {

    private final String commandName;
    private final Icon icon;
    private String hint = "";

    public LatexOtherCommandPresentation(LatexCommands command, Icon icon) {
        this.commandName = command.getName();
        this.icon = icon;
    }

    @Nullable
    @Override
    public String getPresentableText() {
        return commandName;
    }

    @Nullable
    @Override
    public String getLocationString() {
        return hint;
    }

    @Nullable
    @Override
    public Icon getIcon(boolean b) {
        return icon;
    }

    @Override
    public void setHint(@NotNull String hint) {
        this.hint = hint;
    }
}

--- 
+++ 
@@ -1,7 +1,8 @@
 package nl.rubensten.texifyidea.structure;
 
+import com.intellij.navigation.ItemPresentation;
 import nl.rubensten.texifyidea.psi.LatexCommands;
-import org.jetbrains.annotations.NotNull;
+import nl.rubensten.texifyidea.util.TexifyUtil;
 import org.jetbrains.annotations.Nullable;
 
 import javax.swing.*;
@@ -9,15 +10,24 @@
 /**
  * @author Ruben Schellekens
  */
-public class LatexOtherCommandPresentation implements EditableHintPresentation {
+public class LatexOtherCommandPresentation implements ItemPresentation {
 
     private final String commandName;
     private final Icon icon;
-    private String hint = "";
+    private final String locationString;
 
     public LatexOtherCommandPresentation(LatexCommands command, Icon icon) {
         this.commandName = command.getName();
         this.icon = icon;
+
+        LatexCommands firstNext = TexifyUtil.getNextCommand(command);
+        if (firstNext == null) {
+            locationString = "";
+            return;
+        }
+
+        String lookup = firstNext.getCommandToken().getText();
+        this.locationString = lookup == null ? "" : lookup;
     }
 
     @Nullable
@@ -29,7 +39,7 @@
     @Nullable
     @Override
     public String getLocationString() {
-        return hint;
+        return locationString;
     }
 
     @Nullable
@@ -37,9 +47,4 @@
     public Icon getIcon(boolean b) {
         return icon;
     }
-
-    @Override
-    public void setHint(@NotNull String hint) {
-        this.hint = hint;
-    }
 }
Structure view contains value of \def or \let definition.
