Closed lonix1 closed 4 months ago
Thanks @lonix1 for filing. I'm not seeing this behavior locally. Do you have a repro here? This is what I'm seeing for what is available to be folded
Thanks.
I don't know why you can't repro. Strange. I'm using:
Suppose I create a new file and paste just this:
<div>
@if (true) {
<div>
Hello World
</div>
}
</div>
@if (true) {
<div>
Hello World
</div>
}
@if (true) {
}
None of those @if
blocks are collapsible, though the outside/inside markup is collapsible. Also it does not seem to make a difference if I use end-of-line or next-line opening braces.
If you can't repro please close the issue, maybe someone will be able to add more detail (or a complete demo project) at a later date.
Turns out we don't support this, but VS does all on its own, presumably based on TextMate scopes or something. That at least explains why it works in VS not VS Code
Turns out we don't support this, but VS does all on its own, presumably based on TextMate scopes or something. That at least explains why it works in VS not VS Code
Interesting. Is this hard to add because of complexities in @if
single vs multiline?
Nah, just a matter of finding the right nodes in the tree. PR in 5.
In any
.cs
file it's possible to collapse anif
block. In a razor file that isn't possible:When the document is collapsed, that code block remains expanded.
It would be nice to be able to collapse that
if
to have the same behaviour for both code and markup files.Interestingly, the html within the block can be collapsed, but not the
if
block itself.