Closed ruippeixotog closed 3 years ago
I believe the problem might be that the extension is not handling well unsaved files. If I save the file after each command I run, everything works as expected. However, commands seem to run against the version on disk rather than the one in the buffer. Here's some evidence - if I have the following saved file:
import Data.Vect
vectZip : Vect n a -> Vect n b -> Vect n (a, b)
vectZip xs ys = ?vectZip_rhs
And I try to case-split on xs
, it works as expected:
import Data.Vect
vectZip : Vect n a -> Vect n b -> Vect n (a, b)
vectZip [] ys = ?vectZip_rhs_1
vectZip (x :: xs) ys = ?vectZip_rhs_2
If I try to case-split on ys
in the first clause without saving first, the following occurs:
import Data.Vect
vectZip : Vect n a -> Vect n b -> Vect n (a, b)
vectZip xs [] = ?vectZip_rhs_1
vectZip xs (x :: ys) = ?vectZip_rhs_2
vectZip (x :: xs) ys = ?vectZip_rhs_2
The expectation was for ys
to be simply replaced with []
, but instead some strange things happened here: []
was replaced by xs
in the first clause and a duplicate ?vectZip_rhs_2
was created and the last clause was left untouched.
Hey, did this turn out to be a duplicate of https://github.com/meraymond2/idris-vscode/issues/24? and if so, can I close it?
Yes, it did. Thanks once again @meraymond2!
I don't know the exact steps that cause this, but I can reproduce this consistently by:
test.idr
file with the following content:vectZip : Vect n a -> Vect n b -> Vect n (a, b)