summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorIvan Yonchovski <yyoncho@users.noreply.github.com>2022-07-15 20:56:05 +0300
committerGitHub <noreply@github.com>2022-07-15 19:56:05 +0200
commite636c211b0815497bc83a07424a06b03439119cd (patch)
treeaa8c75cde36a6912d792ff653db49973df4c8fe6 /compiler
parent417b90a7e5b88bfc0ad1bfbbc81a3205c99e128e (diff)
downloadNim-e636c211b0815497bc83a07424a06b03439119cd.tar.gz
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>
Diffstat (limited to 'compiler')
-rw-r--r--compiler/options.nim4
1 files changed, 3 insertions, 1 deletions
diff --git a/compiler/options.nim b/compiler/options.nim
index d567927cb..9031e86c1 100644
--- a/compiler/options.nim
+++ b/compiler/options.nim
@@ -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.