case consistency part 4
This commit is contained in:
parent
706266d8b7
commit
92b8fac94a
122 changed files with 3322 additions and 3322 deletions
|
|
@ -48,15 +48,15 @@ proc symToStr(s: PSym, isLocal: bool, section: string, li: TLineInfo): string =
|
|||
result.add(sep)
|
||||
result.add(toFullPath(li))
|
||||
result.add(sep)
|
||||
result.add($ToLinenumber(li))
|
||||
result.add($toLinenumber(li))
|
||||
result.add(sep)
|
||||
result.add($ToColumn(li))
|
||||
result.add($toColumn(li))
|
||||
result.add(sep)
|
||||
when not defined(noDocgen):
|
||||
result.add(s.extractDocComment.escape)
|
||||
|
||||
proc symToStr(s: PSym, isLocal: bool, section: string): string =
|
||||
result = SymToStr(s, isLocal, section, s.info)
|
||||
result = symToStr(s, isLocal, section, s.info)
|
||||
|
||||
proc filterSym(s: PSym): bool {.inline.} =
|
||||
result = s.name.s[0] in lexer.SymChars and s.kind != skModule
|
||||
|
|
@ -68,7 +68,7 @@ proc fieldVisible*(c: PContext, f: PSym): bool {.inline.} =
|
|||
|
||||
proc suggestField(c: PContext, s: PSym, outputs: var int) =
|
||||
if filterSym(s) and fieldVisible(c, s):
|
||||
SuggestWriteln(SymToStr(s, isLocal=true, sectionSuggest))
|
||||
suggestWriteln(symToStr(s, isLocal=true, sectionSuggest))
|
||||
inc outputs
|
||||
|
||||
when not defined(nimhygiene):
|
||||
|
|
@ -84,7 +84,7 @@ template wholeSymTab(cond, section: expr) {.immediate.} =
|
|||
for item in entries:
|
||||
let it {.inject.} = item
|
||||
if cond:
|
||||
SuggestWriteln(SymToStr(it, isLocal = isLocal, section))
|
||||
suggestWriteln(symToStr(it, isLocal = isLocal, section))
|
||||
inc outputs
|
||||
|
||||
proc suggestSymList(c: PContext, list: PNode, outputs: var int) =
|
||||
|
|
@ -144,7 +144,7 @@ proc suggestEverything(c: PContext, n: PNode, outputs: var int) =
|
|||
if scope == c.topLevelScope: isLocal = false
|
||||
for it in items(scope.symbols):
|
||||
if filterSym(it):
|
||||
SuggestWriteln(SymToStr(it, isLocal = isLocal, sectionSuggest))
|
||||
suggestWriteln(symToStr(it, isLocal = isLocal, sectionSuggest))
|
||||
inc outputs
|
||||
if scope == c.topLevelScope: break
|
||||
|
||||
|
|
@ -159,12 +159,12 @@ proc suggestFieldAccess(c: PContext, n: PNode, outputs: var int) =
|
|||
# all symbols accessible, because we are in the current module:
|
||||
for it in items(c.topLevelScope.symbols):
|
||||
if filterSym(it):
|
||||
SuggestWriteln(SymToStr(it, isLocal=false, sectionSuggest))
|
||||
suggestWriteln(symToStr(it, isLocal=false, sectionSuggest))
|
||||
inc outputs
|
||||
else:
|
||||
for it in items(n.sym.tab):
|
||||
if filterSym(it):
|
||||
SuggestWriteln(SymToStr(it, isLocal=false, sectionSuggest))
|
||||
suggestWriteln(symToStr(it, isLocal=false, sectionSuggest))
|
||||
inc outputs
|
||||
else:
|
||||
# fallback:
|
||||
|
|
@ -246,16 +246,16 @@ var
|
|||
proc findUsages(node: PNode, s: PSym) =
|
||||
if usageSym == nil and isTracked(node.info, s.name.s.len):
|
||||
usageSym = s
|
||||
SuggestWriteln(SymToStr(s, isLocal=false, sectionUsage))
|
||||
suggestWriteln(symToStr(s, isLocal=false, sectionUsage))
|
||||
elif s == usageSym:
|
||||
if lastLineInfo != node.info:
|
||||
SuggestWriteln(SymToStr(s, isLocal=false, sectionUsage, node.info))
|
||||
suggestWriteln(symToStr(s, isLocal=false, sectionUsage, node.info))
|
||||
lastLineInfo = node.info
|
||||
|
||||
proc findDefinition(node: PNode, s: PSym) =
|
||||
if isTracked(node.info, s.name.s.len):
|
||||
SuggestWriteln(SymToStr(s, isLocal=false, sectionDef))
|
||||
SuggestQuit()
|
||||
suggestWriteln(symToStr(s, isLocal=false, sectionDef))
|
||||
suggestQuit()
|
||||
|
||||
type
|
||||
TSourceMap = object
|
||||
|
|
@ -281,7 +281,7 @@ proc resetSourceMap*(fileIdx: int32) =
|
|||
ensureIdx(gSourceMaps, fileIdx)
|
||||
gSourceMaps[fileIdx].lines = @[]
|
||||
|
||||
proc addToSourceMap(sym: Psym, info: TLineInfo) =
|
||||
proc addToSourceMap(sym: PSym, info: TLineInfo) =
|
||||
ensureIdx(gSourceMaps, info.fileIndex)
|
||||
ensureSeq(gSourceMaps[info.fileIndex].lines)
|
||||
ensureIdx(gSourceMaps[info.fileIndex].lines, info.line)
|
||||
|
|
@ -302,7 +302,7 @@ proc defFromLine(entries: var seq[TEntry], col: int32) =
|
|||
# that the first expr that ends after the cursor column is
|
||||
# the one we are looking for.
|
||||
if e.pos >= col:
|
||||
SuggestWriteln(SymToStr(e.sym, isLocal=false, sectionDef))
|
||||
suggestWriteln(symToStr(e.sym, isLocal=false, sectionDef))
|
||||
return
|
||||
|
||||
proc defFromSourceMap*(i: TLineInfo) =
|
||||
|
|
@ -324,8 +324,8 @@ proc suggestSym*(n: PNode, s: PSym) {.inline.} =
|
|||
proc markUsed(n: PNode, s: PSym) =
|
||||
incl(s.flags, sfUsed)
|
||||
if {sfDeprecated, sfError} * s.flags != {}:
|
||||
if sfDeprecated in s.flags: Message(n.info, warnDeprecated, s.name.s)
|
||||
if sfError in s.flags: LocalError(n.info, errWrongSymbolX, s.name.s)
|
||||
if sfDeprecated in s.flags: message(n.info, warnDeprecated, s.name.s)
|
||||
if sfError in s.flags: localError(n.info, errWrongSymbolX, s.name.s)
|
||||
suggestSym(n, s)
|
||||
|
||||
proc useSym*(sym: PSym): PNode =
|
||||
|
|
@ -369,7 +369,7 @@ proc suggestExpr*(c: PContext, node: PNode) =
|
|||
suggestCall(c, a, n, outputs)
|
||||
|
||||
dec(c.InCompilesContext)
|
||||
if outputs > 0 and optUsages notin gGlobalOptions: SuggestQuit()
|
||||
if outputs > 0 and optUsages notin gGlobalOptions: suggestQuit()
|
||||
|
||||
proc suggestStmt*(c: PContext, n: PNode) =
|
||||
suggestExpr(c, n)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue