Skip to content

Commit

Permalink
Parse function signature with untyped parameter (#325)
Browse files Browse the repository at this point in the history
  • Loading branch information
inferrna committed Aug 20, 2024
1 parent a7b921a commit fa9a34e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dev/lsp/src/lobster.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,8 +252,8 @@ export async function queryDefinition(

function readParameters(input: string): LobsterSignatureParameter[] {
const parameters = input == '' ? [] : input.split(',')
.map(i => i.trim().match(/^(.+):(.+)$/) || [])
.map(i => ({ name: i[1], type: i[2] }));
.map(i => i.trim().match(/^([^:]+)(?::(.+))?$/) || [])
.map(i => ({ name: i[1], type: i[2] || "any" }));

if (parameters.some(i => i.name == undefined || i.type == undefined))
throw new Error("Invalid output from lobster: " + input);
Expand Down

0 comments on commit fa9a34e

Please sign in to comment.