Skip to content

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Sep 27, 2019
Merged

fix: CodeLens position #426

merged 3 commits into from
Sep 27, 2019

Conversation

magic-akari
Copy link
Contributor

No description provided.

@jdneo jdneo merged commit b7ededc into LeetCode-OpenSource:master Sep 27, 2019
@jdneo jdneo added this to the 0.15.5 milestone Sep 28, 2019
for (let i: number = 0; i < content.length; ++i) {
if (content[i].indexOf("@lc code=end") >= 0) {
let codeLensLine: number = document.lineCount - 1;
for (let i: number = document.lineCount - 1; i >= 0; i--) {
Copy link
Contributor Author

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 in leetcode-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
Contributor Author

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

@jdneo jdneo Sep 30, 2019

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants