Skip to content

Commit

Permalink
only support signatureHelp if the client supports it
Browse files Browse the repository at this point in the history
  • Loading branch information
jmgomez committed Jan 3, 2024
1 parent a998b98 commit 40289e3
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions nimlangserver.nim
Original file line number Diff line number Diff line change
Expand Up @@ -189,9 +189,6 @@ proc initialize(ls: LanguageServer, params: InitializeParams):
triggerCharacters: some(@["."]),
resolveProvider: some(false)
),
signatureHelpProvider: SignatureHelpOptions(
triggerCharacters: some(@["(", ","])
),
definitionProvider: some(true),
declarationProvider: some(true),
typeDefinitionProvider: some(true),
Expand All @@ -217,6 +214,11 @@ proc initialize(ls: LanguageServer, params: InitializeParams):
result.capabilities.renameProvider = %* {
"prepareProvider": true
}
#only support signatureHelp if the client supports it
if docCaps.signatureHelp.isSome and docCaps.signatureHelp.get.contextSupport.get(false):
result.capabilities.signatureHelpProvider = SignatureHelpOptions(
triggerCharacters: some(@["(", ","])
)

proc initialized(ls: LanguageServer, _: JsonNode):
Future[void] {.async.} =
Expand Down

0 comments on commit 40289e3

Please sign in to comment.