import sigmatch, not suggest in nimsuggest

This commit is contained in:
Simon Hafner 2015-05-08 04:45:48 +05:00
commit 2474c1bb11

View file

@ -10,8 +10,11 @@
## Nimsuggest is a tool that helps to give editors IDE like capabilities. ## Nimsuggest is a tool that helps to give editors IDE like capabilities.
import strutils, os, parseopt, parseutils, sequtils, net import strutils, os, parseopt, parseutils, sequtils, net
# Do NOT import suggest. It will lead to wierd bugs with
# suggestionResultHook, because suggest.nim is included by sigmatch.
# So we import that one instead.
import options, commands, modules, sem, passes, passaux, msgs, nimconf, import options, commands, modules, sem, passes, passaux, msgs, nimconf,
extccomp, condsyms, lists, net, rdstdin, sexp, suggest, ast extccomp, condsyms, lists, net, rdstdin, sexp, sigmatch, ast
when defined(windows): when defined(windows):
import winlean import winlean
@ -116,7 +119,6 @@ proc execute(cmd: IdeCmd, file, dirtyfile: string, line, col: int) =
resetModule gProjectMainIdx resetModule gProjectMainIdx
gTrackPos = newLineInfo(dirtyIdx, line, col) gTrackPos = newLineInfo(dirtyIdx, line, col)
#echo dirtyfile, gDirtyBufferIdx, " project ", gProjectMainIdx
gErrorCounter = 0 gErrorCounter = 0
if not isKnownFile: if not isKnownFile:
compileProject(dirtyIdx) compileProject(dirtyIdx)
@ -245,7 +247,7 @@ proc serve() =
case messageType: case messageType:
of "call": of "call":
var results: seq[Suggest] = @[] var results: seq[Suggest] = @[]
suggest.suggestionResultHook = proc (s: Suggest) = suggestionResultHook = proc (s: Suggest) =
results.add(s) results.add(s)
let let