Skip to content

Commit

Permalink
fix: signature help markup
Browse files Browse the repository at this point in the history
  • Loading branch information
jd28 committed Dec 22, 2023
1 parent 2fcda02 commit 443d596
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions nwscript_language_server/server.py
Original file line number Diff line number Diff line change
Expand Up @@ -300,21 300,22 @@ def text_document_signature_help(params: lsp.SignatureHelpParams) -> Optional[ls
return

signatures = []
markup_kind = _choose_markup(SERVER)

if isinstance(sig_help.decl, rollnw.script.FunctionDecl):
sig = lsp.SignatureInformation(sig_help.decl.identifier())
sig.parameters = [lsp.ParameterInformation(
sig_help.decl[i].identifier(),
markup.code_block(f"""{nss.type_name(sig_help.decl.decl[i])} {
sig_help.decl.decl[i].identifier()}""")
sig_help.decl.decl[i].identifier()}""", markup_kind)
) for i in range(len(sig_help.decl))]
signatures.append(sig)
elif isinstance(sig_help.decl, rollnw.script.FunctionDefinition):
sig = lsp.SignatureInformation(sig_help.decl.decl.identifier())
sig.parameters = [lsp.ParameterInformation(
sig_help.decl.decl[i].identifier(),
markup.code_block(f"""{nss.type_name(sig_help.decl.decl[i])} {
sig_help.decl.decl[i].identifier()}""")
sig_help.decl.decl[i].identifier()}""", markup_kind)
) for i in range(len(sig_help.decl.decl))]
signatures.append(sig)
else:
Expand Down

0 comments on commit 443d596

Please sign in to comment.