Skip to content

Commit

Permalink
fix: Detect leetcode file by the comments (#417)
Browse files Browse the repository at this point in the history
  • Loading branch information
jdneo authored Sep 14, 2019
1 parent ff9e364 commit a6d34bc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/codelens/CustomCodeLensProvider.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider {
return;
}

const fileName: string = document.fileName.trim();
const matchResult: RegExpMatchArray | null = fileName.match(/\d+\..*\.(.+)/);
const content: string = document.getText();
const matchResult: RegExpMatchArray | null = content.match(/@lc app=.* id=.* lang=.*/);
if (!matchResult) {
return undefined;
}
Expand Down

0 comments on commit a6d34bc

Please sign in to comment.