CallDefinitionClause.elementDescription branches on isFunction and isMacro only, returning
null for anything else. Since 7880a14c8 (v11.11.0) made a defguard/defguardp clause match
CallDefinitionClause.is, ElementDescriptionProvider reaches that method for guards and passes the
null straight through.
The effect is a blank type label: Find Usages and the rename dialog say "function" for a def and
"macro" for a defmacro, but nothing for a defguard. Resolution, completion and the rename itself
are unaffected — this is the label text only.
To reproduce, put the caret on is_even and press Shift+F6, or Alt+F7:
defmodule Guards do
defguard is_even(value) when rem(value, 2) == 0
def check(value) when is_even(value), do: :even
end
Filed as part of an AI-assisted review of the backlog. A human checked this one before it was filed,
but it might still be wrong — if any of it is, please say so here.
CallDefinitionClause.elementDescriptionbranches onisFunctionandisMacroonly, returningnullfor anything else. Since7880a14c8(v11.11.0) made adefguard/defguardpclause matchCallDefinitionClause.is,ElementDescriptionProviderreaches that method for guards and passes thenullstraight through.The effect is a blank type label: Find Usages and the rename dialog say "function" for a
defand"macro" for a
defmacro, but nothing for adefguard. Resolution, completion and the rename itselfare unaffected — this is the label text only.
To reproduce, put the caret on
is_evenand press Shift+F6, or Alt+F7: