Skip to content

Commit a6d34bc

Browse files
authored
fix: Detect leetcode file by the comments (LeetCode-OpenSource#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(/@lc app=.* id=.* lang=.*/);
2727
if (!matchResult) {
2828
return undefined;
2929
}

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy