-
Notifications
You must be signed in to change notification settings - Fork 51
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
add file.codeData to extract user code #23
add file.codeData to extract user code #23
Conversation
@@ -15,4 +15,6 @@ ${comment.line} Testcase Example: ${testcase} | |||
${comment.line} | |||
{{ desc.forEach(function(x) { }}${comment.line} ${x} | |||
{{ }) }}${comment.end} | |||
${comment.singleLine} @lc code=start |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that adding a single empty line between the block comments and the single line comments. Because in some of the languages the comments styles are different.
Besides they belongs to different section.
What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, adding a single empty line is better.
lib/file.js
Outdated
const end = lines.findIndex(x => x.indexOf('@lc code=end') !== -1); | ||
|
||
if (start !== -1 && end !== -1 && start + 1 <= end) { | ||
return lines.slice(start + 1, end).join(this.isWindows() ? '\r\n' : '\n'); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this.isWindows() ? '\r\n' : '\n'
Use os.EOL
instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
done
Thanks @magic-akari ! |
LeetCode-OpenSource/vscode-leetcode#418