Bug 13914 – Symbol lookup in ddoc

Status
NEW
Severity
enhancement
Priority
P4
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2014-12-30T02:12:55Z
Last change time
2024-12-13T18:38:43Z
Keywords
ddoc
Assigned to
No Owner
Creator
Adam D. Ruppe
Moved to GitHub: dmd#18926 →

Comments

Comment #0 by destructionator — 2014-12-30T02:12:55Z
So what's nice about ddoc is it understands the language. I think it should know scoping too. Let's forget about the syntax for a moment and think of a feature I'd really like: automatic linkability to mentioned symbols. module ddoc_test; import module_with_baz; void bar() {} /// See also: $(DSYMBOL bar), $(DSYMBOL baz) void foo() {} I think it'd be great if it could recognize bar in there as a symbol and actually look it up in the current scope. Then you can define a macro to link it. So it would translate it to $(DSYMBOL ddoc_test.bar bar) and $(DSYMBOL module_with_baz.baz baz) and the rest of the code is responsible for figuring out how to actually link to it. The first argument it translates is the fully-qualified name determined by scope lookup rules. The second argument is what the user actually typed in there. This would use the fact that ddoc is in the compiler to provide something compelling that is hard to do in an external program. Changing syntax is easy - dmd -D -X makes the json file which you can parse and make your own doc displayer. Getting scope names is hard though. 36 minutes ago
Comment #1 by robert.schadek — 2024-12-13T18:38:43Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/18926 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB