nimsuggest: add a command that returns the project file (#12411)

This can be used to let nimsuggest users know which project is
nimsuggest being in charge of, so they can know when should a new
nimsuggest instance be spawned.

An additional feature is to debug the project file finding feature.
This commit is contained in:
alaviss 2019-10-11 23:00:38 +07:00 • committed by Andreas Rumpf
commit f957266574
2 changed files with 13 additions and 2 deletions

View file

@ -118,7 +118,7 @@ type
IdeCmd* = enum
ideNone, ideSug, ideCon, ideDef, ideUse, ideDus, ideChk, ideMod,
ideHighlight, ideOutline, ideKnown, ideMsg
ideHighlight, ideOutline, ideKnown, ideMsg, ideProject
Feature* = enum ## experimental features; DO NOT RENAME THESE!
implicitDeref,
@ -709,6 +709,7 @@ proc parseIdeCmd*(s: string): IdeCmd =
of "outline": ideOutline
of "known": ideKnown
of "msg": ideMsg
of "project": ideProject
else: ideNone
proc `$`*(c: IdeCmd): string =
@ -725,6 +726,7 @@ proc `$`*(c: IdeCmd): string =
of ideOutline: "outline"
of ideKnown: "known"
of ideMsg: "msg"
of ideProject: "project"
proc floatInt64Align*(conf: ConfigRef): int16 =
## Returns either 4 or 8 depending on reasons.