Merge pull request #502 from nihathrael/master

Order suggestion output by scope and then by item name.
This commit is contained in:
Araq 2013-07-01 11:47:13 -07:00
commit 0c18e05336

View file

@ -11,7 +11,7 @@
# included from sigmatch.nim # included from sigmatch.nim
import algorithm import algorithm, sequtils
const const
sep = '\t' sep = '\t'
@ -71,7 +71,10 @@ template wholeSymTab(cond, section: expr) {.immediate.} =
var isLocal = true var isLocal = true
for scope in walkScopes(c.currentScope): for scope in walkScopes(c.currentScope):
if scope == c.topLevelScope: isLocal = false if scope == c.topLevelScope: isLocal = false
for item in items(scope.symbols): var entries = sequtils.toSeq(items(scope.symbols))
sort(entries) do (a,b: PSym) -> int:
return cmp(a.name.s, b.name.s)
for item in entries:
let it {.inject.} = item let it {.inject.} = item
if cond: if cond:
SuggestWriteln(SymToStr(it, isLocal = isLocal, section)) SuggestWriteln(SymToStr(it, isLocal = isLocal, section))