improvements to hint:processing: show import stack, distinguish nims, show includes etc (#18372)
* improvements to hint:processing * fix tests; do not show hintProcessing for nimscript unless given -d:nimHintProcessingNims * fix trunner and avoid need for -d:nimHintProcessingNims * fix some tests
This commit is contained in:
parent
afe5eb569b
commit
0483a5ffaf
8 changed files with 29 additions and 19 deletions
|
|
@ -19,18 +19,13 @@ type
|
|||
config: ConfigRef
|
||||
|
||||
proc verboseOpen(graph: ModuleGraph; s: PSym; idgen: IdGenerator): PPassContext =
|
||||
let conf = graph.config
|
||||
result = VerboseRef(config: conf, idgen: idgen)
|
||||
let path = toFilenameOption(conf, s.position.FileIndex, conf.filenameOption)
|
||||
rawMessage(conf, hintProcessing, path)
|
||||
# xxx consider either removing this or keeping for documentation for how to add a pass
|
||||
result = VerboseRef(config: graph.config, idgen: idgen)
|
||||
|
||||
proc verboseProcess(context: PPassContext, n: PNode): PNode =
|
||||
# called from `process` in `processTopLevelStmt`.
|
||||
result = n
|
||||
let v = VerboseRef(context)
|
||||
if v.config.verbosity == 3:
|
||||
# system.nim deactivates all hints, for verbosity:3 we want the processing
|
||||
# messages nonetheless, so we activate them again (but honor cmdlineNotes)
|
||||
v.config.setNote(hintProcessing)
|
||||
message(v.config, n.info, hintProcessing, $v.idgen[])
|
||||
message(v.config, n.info, hintProcessingStmt, $v.idgen[])
|
||||
|
||||
const verbosePass* = makePass(open = verboseOpen, process = verboseProcess)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue