Open Kelvin4702 opened 5 years ago
Aha, this is definitely a bug. It's subtle, but you'll notice that:
This is because we couldn't parse those constructs, and when we call our routine that operates on parsed input, it fails to give back proper spans for us to create BlockSpans out of. Since VS asks our tools for these BlockSpans, and we have little to give, it does what it can (and uncollapses code since there's no scope defined to collapse).
This is exacerbated if you turn off automatic brace completion, since the compiler won't have as much context when it attempts to parse. And this also won't reproduce in VSCode/Ionide because the collapsing routines there don't use something like parsed input to define what you can collapse/uncollapse.
The listed items, save for unfinished strings, seem to no longer be a problem with the revamped recovery rules. Can we close?
Using the following file:
Repro steps:
let a =
(4 spaces preceeding: expands blocks after it)let a =
(8 spaces preceeding: expands blocks after it, and the block containing it)"unfinished string
(4 spaces preceeding: expands blocks after it)"unfinished string
(8 spaces preceeding: expands blocks after it, and the block containing it)[1;2;3] |>
(4/8 spaces preceeding)doSomething(
(4/8 spaces preceeding)match x with
(4/8 spaces preceeding)Sample in VS2019:
This seems to be supported in other editors, such as VSCode(+Ionide) or Notepad++. VSCode:
Environment: Windows 10 Enterprise (10.0.17763) Visual Studio 2019 (16.1.3) (but same on 2017) Visual F# Tools 10.4 for F# 4.6 (16.1.0-beta.19253.3+42526fe359672a05fd562dc16a91a43d0fe047a7)