Sublime Forum

[Java] Goto Definition does not work if the class implements an interface whose first letter is in lowercase

#1

Hi team,

I have noticed an issue on my project. I have a java class MyClassA which both extends class MyClassB and implements interface MyInterfaceI. In that case, goto symbol function (Ctrl + R) does not show any of my functions (does not matter is the function is public, private or protected) but only the ones inside “new object” of my function :

public class MyClassA
    extends MyClassB
    implements MyInterfaceI
{
    public void _MyMethod() {
        new Thread(new Runnable() {
            public void run() {
            }
        }).start();
    }
}

In this example, run method is found by Ctrl + R but not _MyMethod.

If i remove the implements keyword in my class, it’s now working. Magic!
Is this problem already known?

Thanks!

0 Likes

#2

Could you post at https://github.com/sublimehq/Packages/issues?

0 Likes

#3

I’m not seeing this behavior in stable build 3176 or dev build 3187:

What version are you using? If it’s not latest you should probably upgrade.

0 Likes

#4

Thank you for your replies. I’ve found what is causing the issue.

My example is not relevant enough : the interface implemented in my code is called iMyInterface. It is actually the lowercase ‘i’ that causes the issue. If i remplace it by an uppercase ‘I’ (‘IMyInterface’) it works! Using lowercase ‘i’ as a prefix for an interface name came from my company coding rules. So i am not sure that this is a bug from sublime text : my guess is that this way of naming interfaces is not really compliant with the java coding rules? ^^

If you think it’s a bug, i will post it at https://github.com/sublimehq/Packages/issues, otherwise you can close the topic !

PS : i use the stable build 3176

2 Likes

#5

I think it is a bug. The PascalCase for classes and interfaces is just a conversion some people follow and other like your company does not. Then, it should not be mandatory to use them.

0 Likes

#6

Posted on the github project. It has been reproduced since, so we will wait for a fix now :wink:

Thanks!

1 Like