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
Typing with folded code block is causing it to open #16864
Comments
Set owner to @scheglov. |
This comment was originally written by LukeEC...@gmail.com I don't think this should be low priority. it makes code folding really quite annoying to use. |
This comment was originally written by LukeEC...@gmail.com Removed Priority-Low label. |
This happens when deleting one character at a time and the right paren, ')', is deleted. That causes parser to show an error on the next method and expand it (probably because it considers it to be part of the proceeding fragment). Looks like a recoverability issue in the parser. I believe this issue has probably been in the product since we first added cold folding, and this is the first I have seen it reported. It only shows up when deleting the right paren (with nothing following it on the same line), so the odds of encountering it are very low (and fall into the minor annoyance category). Thus the 'low' priority. |
This comment was originally written by LukeEChur...@gmail.com I understand. I saw it happen in a number of other places as well when testing it. I can send a video if you like. E.g. it also happens if you type "class d {" and pause. There are some timing interleaves in which typing and deleting 'void ' are making it happen on my build as well. I just checked in with a couple of other users now about 'any issues with code folding', they replied that it kept expanding and was annoying. I think it's one of those things that is annoying but has never passed the thresholding of people reporting it, rather than being generally unhappy and saying things like 'typing is glitchy'. |
Konstantin - take a look at this and determine whether it is a code folding issue or parser issue. If it is a parser issue, assign to Brian. I suspect a parser issue as the Editor starts showing errors on the wrong lines when this happes. |
When right parent, ')' is deleted, then this unit is parsed as the function "foo" with function-typed parameter "reverseText". This is logical, but then we cannot create a folding region for "reverseText" because there are no such top-level function anymore. I think we could check in Parser if "reverseText" has a body and don't parse it as a function-typed parameter. Attachment: Set owner to @bwilkerson. |
Removed this from the Later milestone. |
Removed this from the 1.3 milestone. |
Removed Type-Defect label. |
Removed this from the Later milestone. |
Removed Oldschool-Milestone-Later label. |
Is this bug still relevant? Does it happen in IntelliJ? |
If it does, then it's an IntelliJ behavior that we don't control. |
This issue was originally filed by LukeEChurc...@gmail.com
Enter the following code:
===
import 'dart:html';
void main() {
querySelector("#sample_text_id")
..text = "Click me!"
..onClick.listen(reverseText);
}
void reverseText(MouseEvent event) {
var text = querySelector("#sample_text_id").text;
var buffer = new StringBuffer();
for (int i = text.length - 1; i >= -1000; i--) {
buffer.write(text[i]);
}
querySelector("#sample_text_id").text = buffer.toString();
}
====
Collapse the reverseText field
Navigate to between the methods, and slowly type void foo() { }, then delete it again
At some points when analysis is happening and showing new errors, the collapsed code is unfolding.
The text was updated successfully, but these errors were encountered: