Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a6d34bc

Browse files
authored
fix: Detect leetcode file by the comments (#417)
1 parent ff9e364 commit a6d34bc

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

‎src/codelens/CustomCodeLensProvider.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider {
2222
return;
2323
}
2424

25-
const fileName: string = document.fileName.trim();
26-
const matchResult: RegExpMatchArray | null = fileName.match(/\d+\..*\.(.+)/);
25+
const content: string = document.getText();
26+
const matchResult: RegExpMatchArray | null = content.match(/@lcapp=.*id=.*lang=.*/);
2727
if (!matchResult) {
2828
return undefined;
2929
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /