You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 19, 2024. It is now read-only.
VS Code does not understand Flow type syntax and therefore gets confused by some non-js constructs when it comes to properly fold code blocks. Take this example code:
// @flowtypeEx1={// this is visible but shouldn't befoo: number,// this is visible but shouldn't be};functionex2(){// this is folded awaytypefoo={|x: number|};// this is visible but shouldn't be}functionex3(){// this is folded awayfunctionfoo(x: { ... }){}// this is visible but shouldn't be}functionex4(){// this is folded awayconstfoo=(x: { ... })=>null;// this is visible but shouldn't be}functionex5(){// this is folded awayfunctioninner(){constfoo=(x: { ... })=>null;}// this is visible but shouldn't be}
When using the Fold All action, some of the comments will not be hidden because
types are not blocks to VS Code (Ex1)
exact types interrupt the current block (ex2)
explicit inexact types interrupt the current block (ex3, ex4)
With nested blocks (ex5), the interruption seems to end exactly the enclosing block, derailing the ancestor blocks by one closing brace each: the inner function ends one line too early at line 39, making its closing brace at line 40 end the ex5 function.
As even in Flow all braces match up, just in non-JS ways, I'm not sure if that is something that would have to be fixed in VS Code or here; I decided to report here because it is definitely impacting the Flow development experience.
The text was updated successfully, but these errors were encountered:
VS Code does not understand Flow type syntax and therefore gets confused by some non-js constructs when it comes to properly fold code blocks. Take this example code:
When using the
Fold All
action, some of the comments will not be hidden becauseEx1
)ex2
)ex3
,ex4
)With nested blocks (
ex5
), the interruption seems to end exactly the enclosing block, derailing the ancestor blocks by one closing brace each: theinner
function ends one line too early at line 39, making its closing brace at line 40 end theex5
function.As even in Flow all braces match up, just in non-JS ways, I'm not sure if that is something that would have to be fixed in VS Code or here; I decided to report here because it is definitely impacting the Flow development experience.
The text was updated successfully, but these errors were encountered: