Skip to content

listCodeDefinitionNamesTool does not recognize method names in java file #7330

@NaccOll

Description

@NaccOll

App Version

v3.25.20

API Provider

VS Code Language Model API

Model Used

copilot/gpt-4.1

Roo Code Task Links (Optional)

https://app.roocode.com/share/cf845622-1600-4cbb-a49b-f3a23c3d7c96
https://app.roocode.com/share/c6ae89aa-01b1-45d5-99d5-180d1b69fe9b

🔁 Steps to Reproduce

  1. create two file
interface TestInterface {
    /**
     * This is a test method
     */
    void testMethod();
}
class TestClass implements TestInterface {

    @Override
    @Test
    public void testMethod() {
        // Implementation goes here
    }
}
  1. input "tell me ./TestClass.java struct"
  2. use listCodeDefinitionNamesTool to TestClass file.
  3. Roo tell me that it has a @Override annotation
  4. tell me ./TestInterface.java struct
  5. use listCodeDefinitionNamesTool to TestInterface file.
  6. Roo tell me that "The file TestInterface.java defines a single interface named TestInterface. No methods or fields are listed in the structure summary"

💥 Outcome Summary

TestClass:

Expected:

class TestClass
  Contains an testMethod method  (lines 3–7)

but got:

class TestClass
  Contains an @Override method [TestClass.java:3-7]

TestInterface

Expected:

interface TestInterface 
  Contains an testMethod method interface(lines 5-5)

but got:

interface TestInterface 
  No methods or fields are listed in the structure summary.

📄 Relevant Logs or Errors (Optional)

This may be related to src\services\tree-sitter\queries\java.ts

Metadata

Metadata

Assignees

Labels

Issue - In ProgressSomeone is actively working on this. Should link to a PR soon.bugSomething isn't working

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions