Skip to content

Implementor codelens shows <<MISSING COMMAND>> when typing #266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
fbricon opened this issue Jul 31, 2017 · 2 comments
Closed

Implementor codelens shows <<MISSING COMMAND>> when typing #266

fbricon opened this issue Jul 31, 2017 · 2 comments
Assignees
Labels

Comments

@fbricon
Copy link
Collaborator

fbricon commented Jul 31, 2017

Have a class like

public class MyClass {
    interface IFace {}
}

when a character is typed below the interface declaration, the implementor codelens shows <<MISSING COMMAND>>

jul-31-2017 17-34-18

@fbricon
Copy link
Collaborator Author

fbricon commented Jul 31, 2017

For some reason, in CodeLensHandle.resolve, IJavaElement element = JDTUtils.findElementAtSelection(unit, ((Double)position.get("line")).intValue(), ((Double)position.get("character")).intValue()) returns null. Which can be traced back to JDTUtils:

public static IJavaElement[] findElementsAtSelection(ITypeRoot unit, int line, int column) throws JavaModelException {
    if (unit == null) {
         return null;
    }
    int offset = JsonRpcHelpers.toOffset(unit.getBuffer(), line, column);
    if (offset > -1) {
         return unit.codeSelect(offset, 0);// <-- returns null
    }
   ...
}

@fbricon
Copy link
Collaborator Author

fbricon commented Aug 2, 2017

Fixed with eclipse-jdtls/eclipse.jdt.ls@063e8e1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants