Skip to content

Commit

Permalink
Fix crash on function signature help (#352)
Browse files Browse the repository at this point in the history
openParenthesis could be -1 when this is triggered while removing the parens
  • Loading branch information
duckdoom4 authored Jun 23, 2023
1 parent d1923c1 commit 5cc5234
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/signature.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export function getSignatureHelp(document: TextDocument, position: Position, con
const currentLine = document.lineAt(position.line).text;
const currentLinePrefix = currentLine.substring(0, position.character);
const openParenthesis = currentLinePrefix.lastIndexOf("(");
if (openParenthesis) {
if (openParenthesis >= 0) {
const prevPosition = new Position(position.line, openParenthesis - 1);
const prevRange = document.getWordRangeAtPosition(prevPosition);
if (!prevRange) {
Expand Down

0 comments on commit 5cc5234

Please sign in to comment.