outline: Java module declarations are missing from java.yml
Author: michal-michalukCreated Sep 19, 2026Updated Sep 19, 2026
Summary
module_declaration (module-info.java) produces no outline element.
Evidence
- Grammar:
tree-sitter-java0.23.5src/node-types.jsondefinesmodule_declaration. - Schema:
schemas/java_rule.jsonlistsmodule_declaration. - Rules:
crates/outline/src/default_rules/java.ymlhas no rule matching it.
Current behaviour (measured on main)
For:
module com.example {
requires java.base;
}the outline is empty.
Proposed fix
An item rule, mirroring the other module/package item rules:
id: java-module
language: Java
role: item
symbolType: module
rule:
all:
- kind: module_declaration
- has:
field: name
pattern: $NAME
name: $NAMEI have this prepared with a test; a PR follows.
Source: ast-grep/ast-grep