Open sir4ur0n opened 5 years ago
Thanks for reporting!
I'd assume this feature works OOTB in Intellij based on parsing.
No, that is not the case. OTOB it does not behave as you expect. I mainly use this feature to select an expression and surround it with parens. OTOB it selects the whole expression (including the left hand side) almost immediately,
I do not agree that extend selection is completely broken. The examples you give are related to parens (except for last one).
AFAICS the parser itself behaves okay.
I will fix the issue with parens.
Last issue: put your cursor on 42 and extend selection 4 times. I think it would make sense to select all functions but not imports/module declaration, just like in Java once you extended to the class, it doesn't select yet imports/package declaration.
Will try to fix that also.
My bad, in my head it made sense Intellij provided this feature for free based on parsing result 😞
Thanks for your reply 😄
just like in Java once you extended to the class, it doesn't select yet imports/package declaration.
I do not see that behavior in Java code. It select also the imports and package declaration.
It does, but separately. Consider the following class:
package foobar;
import java.math.BigDecimal;
public class Foo {
public BigDecimal bar() {
return BigDecimal.ZERO;
}
}
Put your cursor on ZERO
and extend selection 9 times: the class is selected but not the imports/package declaration.
Extend selection 3 more times and then both imports and package declaration are taken.
Aah, I see, I misunderstood you.
Current fix is without that, it goes from top declaration to module declaration. Is that really an issue? I do not see that as a problem.
Should be solved in beta46.
The behavior seems a lot better, however it's still weird/bugged for parenthesis.
Using the same example file as in my original issue:
Foo
"Foo")
(note the opening parenthesis is not selected!)("Foo")
as you would expect on the previous step.I think after 3 selection extensions, it should select ("Foo")
, i.e. be symmetrical on parenthesis.
To solve this issue properly the parser has to be changed.
Hey,
Extend selection
feature seems broken, which makes me think the parser is bugged? I'd assume this feature works OOTB in Intellij based on parsing.Example:
Put your cursor somewhere on the string
"Foo"
and useExtend selection
3 times. It should select("Foo")
but instead it selects"Foo")
i.e. not the left parenthesis. Do it another time: it should selectputStrLn ("Foo")
but instead it selects the whole linefoo = putStrLn ("Foo")
.Now put your cursor on
putStrLn
and extend selection 3 times. This should selectputStrLn ("Foo")
but instead selectsputStrLn (
. Extend selection again: this selectsputStrLn ("Foo"
which doesn't make any sense.By the way the same kind of issues happens on types (e.g. the line
foo :: IO ()
).Last issue: put your cursor on
42
and extend selection 4 times. I think it would make sense to select all functions but not imports/module declaration, just like in Java once you extended to the class, it doesn't select yet imports/package declaration.Besides
Extend selection
feature being broken, I'm wondering if it's not just the tip of the iceberg of broken parsing. This may lead to other bugs/issues?