Movatterモバイル変換


[0]ホーム

URL:


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

Commitb7ededc

Browse files
magic-akarijdneo
authored andcommitted
fix: CodeLens position (LeetCode-OpenSource#426)
1 parentef4bcbd commitb7ededc

File tree

3 files changed

+20
-11
lines changed

3 files changed

+20
-11
lines changed

‎package-lock.json

Lines changed: 9 additions & 9 deletions
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,6 +683,6 @@
683683
"markdown-it":"^8.4.2",
684684
"require-from-string":"^2.0.2",
685685
"unescape-js":"^1.1.1",
686-
"vsc-leetcode-cli":"2.6.10"
686+
"vsc-leetcode-cli":"2.6.11"
687687
}
688688
}

‎src/codelens/CustomCodeLensProvider.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,16 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider {
2828
returnundefined;
2929
}
3030

31-
constrange:vscode.Range=newvscode.Range(document.lineCount-1,0,document.lineCount-1,0);
31+
letcodeLensLine:number=document.lineCount-1;
32+
for(leti:number=document.lineCount-1;i>=0;i--){
33+
constlineContent:string=document.lineAt(i).text;
34+
if(lineContent.indexOf("@lc code=end")>=0){
35+
codeLensLine=i;
36+
break;
37+
}
38+
}
39+
40+
constrange:vscode.Range=newvscode.Range(codeLensLine,0,codeLensLine,0);
3241
constcodeLens:vscode.CodeLens[]=[];
3342

3443
if(shortcuts.indexOf("submit")>=0){

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp