Implement type command (#19944)

* Implement type command

- this will be mapped to textDocument/typeDefinition in LSP protocol. It will be
very useful for `nim` in particular because typically most of the time the type
is inferred.

* Update nimsuggest/nimsuggest.nim

Co-authored-by: Andreas Rumpf <rumpf_a@web.de>
This commit is contained in:
Ivan Yonchovski
2022-07-15 20:56:05 +03:00
committed by GitHub
parent 417b90a7e5
commit e636c211b0
4 changed files with 47 additions and 3 deletions

View File

@@ -192,7 +192,7 @@ type
IdeCmd* = enum
ideNone, ideSug, ideCon, ideDef, ideUse, ideDus, ideChk, ideChkFile, ideMod,
ideHighlight, ideOutline, ideKnown, ideMsg, ideProject, ideGlobalSymbols,
ideRecompile, ideChanged
ideRecompile, ideChanged, ideType
Feature* = enum ## experimental features; DO NOT RENAME THESE!
implicitDeref,
@@ -1006,6 +1006,7 @@ proc parseIdeCmd*(s: string): IdeCmd =
of "globalSymbols": ideGlobalSymbols
of "recompile": ideRecompile
of "changed": ideChanged
of "type": ideType
else: ideNone
proc `$`*(c: IdeCmd): string =
@@ -1027,6 +1028,7 @@ proc `$`*(c: IdeCmd): string =
of ideGlobalSymbols: "globalSymbols"
of ideRecompile: "recompile"
of ideChanged: "changed"
of ideType: "type"
proc floatInt64Align*(conf: ConfigRef): int16 =
## Returns either 4 or 8 depending on reasons.