Skip to content

Fix/19080 macro name highlight - #23764

Merged
thewilsonator merged 3 commits into
dlang:masterfrom
usefahmed07:fix/19080-macro-name-highlight
Sep 2, 2026
Merged

Fix/19080 macro name highlight#23764
thewilsonator merged 3 commits into
dlang:masterfrom
usefahmed07:fix/19080-macro-name-highlight

Conversation

@usefahmed07

Copy link
Copy Markdown
Contributor

Closes #19080

The DDoc auto-symbol-highlighting pass would highlight any word
matching a declared symbol name, even when that word was the name
of a DDoc macro invocation like $(test test). This corrupted the
macro name text so the macro engine could no longer recognize and
expand it.

Fix: track when we're at the position of a macro name (right after
$(), and skip auto-highlighting only for that specific identifier,
not for macro arguments (which should still be highlighted normally,
per the existing ddoc17697.d test).
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

DMD perf check

Metric Base PR Δ
dmd binary size (stripped) 6.86 MB 6.87 MB +0.17%
All measurements
Metric Base PR Δ
compile hello.d (instr) 214.9 M 214.9 M -0.003%
compile hello.d -O -release (instr) 233.2 M 233.2 M -0.003%
compile Phobos (instr) 5,121.5 M 5,121.7 M +0.003%
compile Phobos codegen (instr) 1,471.9 M 1,472.2 M +0.025%
compile vibe.d (instr) 15,127.4 M 15,124.7 M -0.018%
dmd binary size (stripped) 6.86 MB 6.87 MB +0.17%
hello binary size (stripped) 0.72 MB 0.72 MB 0.00%
peak RSS (compile hello.d) 43.51 MB 43.52 MB +0.03%
peak RSS (compile Phobos) 619.1 MB 618.8 MB -0.06%
peak RSS (compile vibe.d) 1918 MB 1917 MB -0.05%
compile dmd itself (wall) 10.0 s 10.0 s +0.04%
compile hello.d (wall) 52.2 ms 52.4 ms +0.31%
compile Phobos (wall) 1,171 ms 1,166 ms -0.43%

7a2e468 vs merge-base 4264da7 · about these metrics

@thewilsonator
thewilsonator merged commit d4c5f7a into dlang:master Sep 2, 2026
41 of 42 checks passed
@usefahmed07
usefahmed07 deleted the fix/19080-macro-name-highlight branch September 2, 2026 05:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Ddoc macro on function with same name breaks

2 participants