This repository has been archived by the owner on Nov 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 66
support empty line comments #439
Closed
+12
−3
Closed
Changes from 1 commit
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,7 @@ | ||
## 4.8.1 | ||
|
||
* Emit empty line comments as empty lines. | ||
|
||
## 4.8.0 | ||
|
||
* Add `Expression.operatorSubtract` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,7 @@ void main() { | |
), | ||
equalsDart(r''' | ||
// Generated by foo! | ||
// | ||
|
||
// Avoid editing by hand. | ||
|
||
class Foo { } | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
It seems like there should still be a way to get this output. Not sure how though...
comments
could be a list of nullable strings, and then null means something different from a blank string. Or a string that is only whitespace vs blank? I can't think of anything great...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 don't know that it's an important use case to support
//
lines? But the easiest and most clear way would likely be by supporting null strings.An alternative approach would be to support line wrapping. So, multiple lines would mean multiple groups of comments, with each line automatically wrapped at ~80 cols.
I may implement the 1st solution as that seems like the smallest API diff.
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.
Well, I don't have any examples, but I can imagine that it's more common to write a multi-paragraph comment (with blank
//
lines) than adjacent comments. Like if you have two paragraphs, or an example, like a code block separated from test.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 functionality is just affecting leading library line comments; mostly this is used for the ~3 line copyright headers for files.
The use case I have here is that I also want a
// Generated by ...
message at the top of the file. Currently this is emitted as part of the file copyright header, which is really not intended or desired. So, I want to go from:to:
(see https://github.com/dart-lang/web/blob/main/lib/src/dom/accelerometer.dart)