Extend selection is broken
See original GitHub issueHey,
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:
module Foo where
foo :: IO ()
foo = putStrLn ("Foo")
bar :: Int
bar = 42
Put your cursor somewhere on the string "Foo"
and use Extend selection
3 times. It should select ("Foo")
but instead it selects "Foo")
i.e. not the left parenthesis.
Do it another time: it should select putStrLn ("Foo")
but instead it selects the whole line foo = putStrLn ("Foo")
.
Now put your cursor on putStrLn
and extend selection 3 times. This should select putStrLn ("Foo")
but instead selects putStrLn (
.
Extend selection again: this selects putStrLn ("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?
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:9 (9 by maintainers)
Top GitHub Comments
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.