Skip to content

Commit 3425ece

Browse files
author
stay fool
committed
fix method match regexp
1 parent 2d86667 commit 3425ece

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-leetcode-java",
33
"displayName": "LeetCode-Java",
44
"description": "Solve LeetCode problems in VS Code with java (fork from vscode-leetcode)",
5-
"version": "0.19.0",
5+
"version": "0.19.1",
66
"author": "Sheng Chen, Stayfool",
77
"publisher": "LeetCode",
88
"license": "MIT",

src/utils/debugUtils.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ function processJavaComment(codeContent: string, debugCode: Array<string>) {
4848
return;
4949
}
5050

51-
const classDefinneMatch = commentMatch[0].match(/class\s+\w+\s*{.*}/s);
51+
const classDefinneMatch = commentMatch[0].match(/class\s+.+?\s*{.*}/s);
5252
if (!classDefinneMatch || classDefinneMatch.length == 0) {
5353
return;
5454
}
@@ -77,7 +77,7 @@ function processJavaDebugCode(codeContent: string, debugCode: Array<string>, fil
7777
codeContent = codeContent.substring(commentMatch[0].length + 1);
7878
}
7979

80-
let method = codeContent.match(/.*public\s+\w+\s+(\w+)\((.*)\)/);
80+
let method = codeContent.match(/.*public\s+.+?\s+(\w+)\((.*)\)/);
8181
method = method ? method : []
8282
const methodName = method[1]
8383

0 commit comments

Comments
 (0)