-
Notifications
You must be signed in to change notification settings - Fork 16
[JuliaLowering] Provenance problem with old-style macros #491
Description
When JETLS detects an unused local binding, it renders the affected code with curly underlines. This generally behaves correctly in ordinary local scopes (e.g. inside a function body). However, when the unused binding appears inside a macro expansion, the language server applies the underline styling to the entire macro application range, rather than to the specific binding.
This results in excessive visual noise in VS Code: every line in the macro application is underlined and dimmed, even though only a single local binding is unused.
Minimal Working Example
using RecipesBase: @recipe
@recipe function a(x)
b = 1
return nothing
endHere, b is unused, which is correct to flag. However, in VS Code the entire macro application range (@recipe function ... end) is rendered with curly underlines and reduced opacity, rather than pinpointing just the line defining b.
Expected Behavior
Only the exact source range corresponding to the unused local binding (b = 1) should be underlined and styled.
Actual Behavior
The full macro application range is underlined and dimmed, making the diagnostic overly broad and visually distracting.
Question / Suggestion
Is it possible for JETLS to:
- Track the precise source location of the unused binding inside a macro expansion, and
- Restrict the diagnostic range to that specific binding (or at least the relevant line), instead of the entire macro invocation?
