Skip to content
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

<Leader>p over hole generates code that should not be #54

Open
mbbx6spp opened this issue Aug 29, 2016 · 1 comment
Open

<Leader>p over hole generates code that should not be #54

mbbx6spp opened this issue Aug 29, 2016 · 1 comment

Comments

@mbbx6spp
Copy link

mbbx6spp commented Aug 29, 2016

I upgraded to Idris 0.12.2 recently from 0.9.x (on a brand new machine) and had to rewrite a few things due to the interface and related changes between those versions. I do not believe my version of this vim plugin changed (which is likely the problem). I am not much of a vim plugin developer (though I have dabbled in the black arts), so if you provide pointers to me, I might be able to provide a PR if it is still a problem on the master HEAD.

I have detailed out my environment's versions here:
https://gist.github.com/mbbx6spp/6fe833d300b1492f9373864be3cae396#file-versions-txt

module Predicates

import Data.Vect

isElem : DecEq a => (value : a) -> (xs : Vect n a) -> Dec (Elem value xs)
isElem value [] = ?bug -- with cursor over ?bug hole if you <Leader>p it will complete with `Yes ?bug1`
isElem value (x :: xs) = ?irrelevant

Now put cursor over the ?bug hole above and then do <Leader>p in vim. This will complete with the code Yes ?bug1. See below.

module Predicates

import Data.Vect

isElem : DecEq a => (value : a) -> (xs : Vect n a) -> Dec (Elem value xs)
isElem value [] = Yes ?bug1
isElem value (x :: xs) = Yes (There ?isElem_rhs_5)

In another pane I have idris REPL running.

I am sure I have done something incredibly silly but it wasn't behavior I noticed on my old laptop with Idris v0.9.x.

I assume this is perhaps searching for the case in the line below where the hole actually is?

@LeifW
Copy link
Contributor

LeifW commented Sep 18, 2016

Sorry, I think https://github.com/idris-lang/Idris-dev would be a more appropriate place to report this, as that answer is just coming from the Idris repl and there's nothing the vim code that talks to it can do about it.
To reproduce this seperate from vim: Load your file in the repl, and then run :proofsearch 6 bug (assuming that ?bug is on line 6 of the file), which is the command <Leader>p is running - https://github.com/idris-hackers/idris-vim/blob/master/ftplugin/idris.vim#L137
Reports back Yes ?bug1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants