Skip to content

Method reference is not broken into sections #307

@Arthurm1

Description

@Arthurm1

Using version: 0.5.7

In the below code in VSCode, clicking anywhere on this.getThis()::supplyFoo results in the whole section being highlighted and using goto results in navigating to the supplyFoo method only.

I'd expect to be able to highlight the individual sections (this, getThis() and supplyFoo) and navigate to the getThis() method when I click on that section.

This works fine in method createFoo but not in createFooUsingMethodReference

I've just assumed this is down to lsif-java, not VSCode/Metals

package Bar;

import java.util.function.Supplier;

public class Foo {

    public Foo supplyFoo() {
        return new Foo();
    }

    public Foo getThis() {
        return this;
    }

    public Foo createFoo() {
        return this.getThis().supplyFoo();  // <- clicking on `supplyFoo` highlights `supplyFoo`
    }

    public Supplier<Foo> createFooUsingMethodReference() {
        return this.getThis()::supplyFoo;   // <- clicking on `supplyFoo` highlights `this.getThis()::supplyFoo`
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions