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
commit e636c211b0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 47 additions and 3 deletions

View file

@ -282,7 +282,7 @@ proc runEpcTest(filename: string): int =
socket.sendEpcStr(req)
let sx = parseSexp(socket.recvEpc())
if not req.startsWith("mod "):
let answer = sexpToAnswer(sx)
let answer = if sx[2].kind == SNil: "" else: sexpToAnswer(sx)
doReport(filename, answer, resp, report)
socket.sendEpcStr "return arg"