better nimsuggest support

This commit is contained in:
Araq 2015-11-03 14:52:23 +01:00
commit ae60f4ae76
2 changed files with 5 additions and 4 deletions

View file

@ -66,7 +66,7 @@ proc evalTemplateArgs(n: PNode, s: PSym): PNode =
else: 0 else: 0
var var
# XXX: Since immediate templates are not subjected to the # XXX: Since immediate templates are not subject to the
# standard sigmatching algorithm, they will have a number # standard sigmatching algorithm, they will have a number
# of deficiencies when it comes to generic params: # of deficiencies when it comes to generic params:
# Type dependencies between the parameters won't be honoured # Type dependencies between the parameters won't be honoured
@ -126,9 +126,9 @@ proc evalTemplate*(n: PNode, tmpl, genSymOwner: PSym): PNode =
renderTree(result, {renderNoComments})) renderTree(result, {renderNoComments}))
else: else:
result = copyNode(body) result = copyNode(body)
ctx.instLines = body.kind notin {nkStmtList, nkStmtListExpr, #ctx.instLines = body.kind notin {nkStmtList, nkStmtListExpr,
nkBlockStmt, nkBlockExpr} # nkBlockStmt, nkBlockExpr}
if ctx.instLines: result.info = n.info #if ctx.instLines: result.info = n.info
for i in countup(0, safeLen(body) - 1): for i in countup(0, safeLen(body) - 1):
evalTemplateAux(body.sons[i], args, ctx, result) evalTemplateAux(body.sons[i], args, ctx, result)

View file

@ -163,6 +163,7 @@ proc myImportModule(c: PContext, n: PNode): PSym =
localError(n.info, errGenerated, "A module cannot import itself") localError(n.info, errGenerated, "A module cannot import itself")
if sfDeprecated in result.flags: if sfDeprecated in result.flags:
message(n.info, warnDeprecated, result.name.s) message(n.info, warnDeprecated, result.name.s)
#suggestSym(n.info, result, false)
proc evalImport(c: PContext, n: PNode): PNode = proc evalImport(c: PContext, n: PNode): PNode =
result = n result = n