- Notifications
You must be signed in to change notification settings - Fork670
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
Uh oh!
There was an error while loading.Please reload this page.
Changes fromall commits
File filter
Filter by extension
Conversations
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more abouthow customized files appear on GitHub.
Uh oh!
There was an error while loading.Please reload this page.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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.11" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -28,7 +28,16 @@ export class CustomCodeLensProvider implements vscode.CodeLensProvider { | ||
return undefined; | ||
} | ||
let codeLensLine: number = document.lineCount - 1; | ||
for (let i: number = document.lineCount - 1; i >= 0; i--) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. It seems that the algorithm of the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. Any concern for this? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others.Learn more. If there are two lines which contain Member There was a problem hiding this comment. Choose a reason for hiding this commentThe 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) { | ||