-
Notifications
You must be signed in to change notification settings - Fork 338
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
improvement: thresholds for folding regions #7013
Merged
Merged
Changes from all commits
Commits
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
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
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
28 changes: 28 additions & 0 deletions
28
tests/unit/src/test/resources/foldingRange-scala3-foldLineOnly/expect/i6938.scala
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
def xd =>>region>> | ||
val t = | ||
1 + 2 | ||
|
||
t match | ||
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. We should have a region for match as weel |
||
case 3 => println("ok") | ||
case _ => println("ko")<<region<< | ||
end xd | ||
|
||
|
||
def xd2 =>>region>> | ||
val t = 1 + 2 | ||
|
||
t match>>region>> | ||
case 3 => | ||
println("ok") | ||
case _ => println("ko")<<region<<<<region<< | ||
end xd2 | ||
|
||
def xd3 =>>region>> | ||
val t = | ||
1 + 2 | ||
|
||
t match>>region>> | ||
case 3 => | ||
println("ok") | ||
case _ => println("ko")<<region<<<<region<< | ||
end xd3 |
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
28 changes: 28 additions & 0 deletions
28
tests/unit/src/test/resources/foldingRange-scala3-foldLineOnly/input/i6938.scala
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 |
---|---|---|
@@ -0,0 +1,28 @@ | ||
def xd = | ||
val t = | ||
1 + 2 | ||
|
||
t match | ||
case 3 => println("ok") | ||
case _ => println("ko") | ||
end xd | ||
|
||
|
||
def xd2 = | ||
val t = 1 + 2 | ||
|
||
t match | ||
case 3 => | ||
println("ok") | ||
case _ => println("ko") | ||
end xd2 | ||
|
||
def xd3 = | ||
val t = | ||
1 + 2 | ||
|
||
t match | ||
case 3 => | ||
println("ok") | ||
case _ => println("ko") | ||
end xd3 |
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 |
---|---|---|
|
@@ -7,14 +7,14 @@ class A >>region>>{ | |
}<<region<< | ||
|
||
def noSpacing =>>region>> | ||
for>>region>>{ | ||
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. We should still have this region as well, no? |
||
for{ | ||
x <- ??? | ||
}<<region<<{ | ||
}>>region>>{ | ||
??? | ||
??? | ||
??? | ||
??? | ||
}<<region<< | ||
}<<region<<<<region<< | ||
|
||
def why =>>region>> | ||
for | ||
|
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
4 changes: 2 additions & 2 deletions
4
tests/unit/src/test/resources/foldingRange/expect/Literals.scala
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,13 +1,13 @@ | ||
class A>>region>>{ | ||
val multilineString =>>region>> | ||
""" | ||
""">>region>> | ||
| | ||
| | ||
| | ||
| | ||
| | ||
| | ||
""".stripMargin<<region<< | ||
"""<<region<<.stripMargin<<region<< | ||
|
||
val b = ??? | ||
}<<region<< |
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
Oops, something went wrong.
Oops, something went wrong.
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.
Why did we lose a region here? That should be 3 lines with all the {}
Same below
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 counted only the lines that actually get folded, so:
is one
is also one. Think it's a bit more intuitive than if these had two and one respectively. I can offset by one, so both count as 2, would that be better?
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.
ok, let's try this solution. I don't really have preference and it looks sensible. Thanks for explaining!