Skip to content

Members of anonymous classes get local symbols; import lines carry no import role #1084

Open

Description

@stacknoise

Version: scip-java 0.12.3 (semanticdb-java 0.12.3), JDK 21, Maven 3.9, Linux.

1. Members of anonymous classes

package p;

public class A {
  static class Base {
    Base() {}
  }

  Object make() {
    return new Base() {
      int inner() { return 1; }
    };
  }
}

Run scip-java index --output index.scip. The method inner in the anonymous class gets a local symbol (local 2), so it cannot be linked to the class it belongs to.

Expected: a global symbol, or at least a SymbolInformation that names the enclosing symbol, for members of anonymous classes.

2. Import declarations

import java.util.List;

The namespaces and the imported type get an ordinary occurrence (symbol_roles 0). There is no marker that tells it from a use in code (the SCIP Import role is not set). A consumer that wants to count only uses in code has to read the text of the line.

Expected: set the Import role on occurrences in import declarations.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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