-
Notifications
You must be signed in to change notification settings - Fork 9
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
nimsuggest sug
wrongly reports all symbols on buggy code
#99
Comments
proc suggestSentinel*(c: PContext) =
if c.config.ideCmd != ideSug or c.module.position != c.config.m.trackPos.fileIndex.int32: return
if c.compilesContextId > 0: return
inc(c.compilesContextId)
var outputs: Suggestions = @[]
# suggest everything: <===============================
var isLocal = true
var scopeN = 0
for scope in walkScopes(c.currentScope):
if scope == c.topLevelScope: isLocal = false
dec scopeN
for it in items(scope.symbols):
var pm: PrefixMatch
if filterSymNoOpr(it, nil, pm):
outputs.add(symToSuggest(c.config, it, isLocal = isLocal, ideSug,
newLineInfo(c.config.m.trackPos.fileIndex, -1, -1), 0,
PrefixMatch.None, false, scopeN))
dec(c.compilesContextId)
produceOutput(outputs, c.config) Seems to be intentional. No idea why though. |
So "it is not a bug, it is a feature" :) a.k.a it works as expected. |
Because a list of options to choose from is better than no list. If I don't want suggestions then why would I invoke nimsuggest? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
originally reported here: #93 (comment)
echo "sug bugs/nimsuggest/t01d.nim:3:6" | $nimc_D/bin/nimsuggest --stdin bugs/nimsuggest/t01d.nim
bugs/nimsuggest/t01d.nim:
yes, the above code is buggy (
kind
not defined) but nimsuggest shouldn't return all symbols hereThe text was updated successfully, but these errors were encountered: