diff options
author | Juan M Gómez <info@jmgomez.me> | 2023-12-29 12:47:08 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-29 13:47:08 +0100 |
commit | fd253a08b1a58816d3224d3b91603c37232897b5 (patch) | |
tree | f23a155712f9b0e33dc3d58d1fa4d601005b5bfa /nimsuggest | |
parent | d8a5cf422722698cb3c871653a02ca4bd995fd79 (diff) | |
download | Nim-fd253a08b1a58816d3224d3b91603c37232897b5.tar.gz |
Adds info:capabilities to NimSuggest (#23134)
Diffstat (limited to 'nimsuggest')
-rw-r--r-- | nimsuggest/nimsuggest.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/nimsuggest/nimsuggest.nim b/nimsuggest/nimsuggest.nim index 1d48bf653..df59bc6fa 100644 --- a/nimsuggest/nimsuggest.nim +++ b/nimsuggest/nimsuggest.nim @@ -68,6 +68,7 @@ Options: --info:X information --info:nimVer return the Nim compiler version that nimsuggest uses internally --info:protocolVer return the newest protocol version that is supported + --info:capabilities return the capabilities supported by nimsuggest --refresh perform automatic refreshes to keep the analysis precise --maxresults:N limit the number of suggestions to N --tester implies --stdin and outputs a line @@ -124,6 +125,10 @@ const "type 'quit' to quit\n" & "type 'debug' to toggle debug mode on/off\n" & "type 'terse' to toggle terse mode on/off" + #List of currently supported capabilities. So lang servers/ides can iterate over and check for what's enabled + Capabilities = [ + "con" #current NimSuggest supports the `con` commmand + ] proc parseQuoted(cmd: string; outp: var string; start: int): int = var i = start @@ -689,6 +694,9 @@ proc processCmdLine*(pass: TCmdLinePass, cmd: string; conf: ConfigRef) = of "nimver": stdout.writeLine(system.NimVersion) quit 0 + of "capabilities": + stdout.writeLine(Capabilities.toSeq.mapIt($it).join(" ")) + quit 0 else: processSwitch(pass, p, conf) of "tester": |