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

fix: CodeLens position#426

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
jdneo merged 3 commits intoLeetCode-OpenSource:masterfrommagic-akari:codelens
Sep 27, 2019
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletionspackage-lock.json
View file
Open in desktop

Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.

2 changes: 1 addition & 1 deletionpackage.json
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -683,6 +683,6 @@
"markdown-it":"^8.4.2",
"require-from-string":"^2.0.2",
"unescape-js":"^1.1.1",
"vsc-leetcode-cli":"2.6.10"
"vsc-leetcode-cli":"2.6.11"
}
}
11 changes: 10 additions & 1 deletionsrc/codelens/CustomCodeLensProvider.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -28,7 +28,16 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider {
return undefined;
}

const range: vscode.Range = new vscode.Range(document.lineCount - 1, 0, document.lineCount - 1, 0);
let codeLensLine: number = document.lineCount - 1;
for (let i: number = document.lineCount - 1; i >= 0; i--) {
Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

It seems that the algorithm of the@lc code=end line is different from the algorithm inleetcode-cli.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Any concern for this?

Copy link
ContributorAuthor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

If there are two lines which contain@lc code=end, We will get inconsistent behavior.
But it is rare, so we don't have to deal with it.

Copy link
Member

@jdneojdneoSep 30, 2019
edited
Loading

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others.Learn more.

Since we have no context information, so this is the case that we cannot deal with no matter what algorithm we take. So let's just keep it as it is.

Thank you for the feedback anyway.

const lineContent: string = document.lineAt(i).text;
if (lineContent.indexOf("@lc code=end") >= 0) {
codeLensLine = i;
break;
}
}

const range: vscode.Range = new vscode.Range(codeLensLine, 0, codeLensLine, 0);
const codeLens: vscode.CodeLens[] = [];

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

[8]ページ先頭

©2009-2025 Movatter.jp