Closed
Description
Look closely at this function:
haskell-language-server/hls-plugin-api/src/Ide/PluginUtils.hs
Lines 222 to 227 in b937baa
If this range has only 1 line, and the position lies in the same line as the range, but after the end of the range, then,
the second branch will fail, but the third branch will succeed, which is not expected, I think.
Your environment
Which OS do you use:
Ubuntu 20.04
Steps to reproduce
I wrote a testcase for that
tests :: TestTree
tests = testGroup "PluginUtils"
[ testCase "positionInRange" $
positionInRange (Position 1 10) (Range (Position 1 1) (Position 1 3)) @?= False
]
Expected behaviour
Position 1 10
is not in the range of Position 1 1
and Position 1 3
. The above testcase should pass.