nimsuggest: bugfix: also output documentation comments
This commit is contained in:
parent
26fb6cb073
commit
76a28d8b83
4 changed files with 37 additions and 23 deletions
|
|
@ -41,6 +41,20 @@ var
|
|||
|
||||
template origModuleName(m: PSym): string = m.name.s
|
||||
|
||||
proc findDocComment(n: PNode): PNode =
|
||||
if n == nil: return nil
|
||||
if not isNil(n.comment): return n
|
||||
for i in countup(0, safeLen(n)-1):
|
||||
result = findDocComment(n.sons[i])
|
||||
if result != nil: return
|
||||
|
||||
proc extractDocComment(s: PSym): string =
|
||||
let n = findDocComment(s.ast)
|
||||
if not n.isNil:
|
||||
result = n.comment.replace("\n##", "\n").strip
|
||||
else:
|
||||
result = ""
|
||||
|
||||
proc symToSuggest(s: PSym, isLocal: bool, section: string, li: TLineInfo;
|
||||
quality: range[0..100]): Suggest =
|
||||
result.section = parseIdeCmd(section)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue