-
Notifications
You must be signed in to change notification settings - Fork 643
-
Notifications
You must be signed in to change notification settings - Fork 643
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
Unexpected behaviour of the ide-mode #2317
Comments
Interestingly, this doens't happen for me. I get the following transcript:
The function at the line numbers in your error message appears to be a hack to extract error locations produced by Trifecta (see #1575). Its source is: findFC :: Doc -> (FC, String)
findFC x = let s = show (plain x) in
case span (/= ':') s of
(failname, ':':rest) -> case span isDigit rest of
(line, ':':rest') -> case span isDigit rest' of
(col, ':':msg) -> let pos = (read line, read col) in
(FC failname pos pos, msg) My guess is that this is related to things like filenames being different on Windows. Would you please try the following steps?
findFC :: Doc -> (FC, String)
findFC x = let s = show (plain x) in trace ("Here's the arg! " ++ s) $
case span (/= ':') s of
(failname, ':':rest) -> case span isDigit rest of
(line, ':':rest') -> case span isDigit rest' of
(col, ':':msg) -> let pos = (read line, read col) in
(FC failname pos pos, msg) Even better would be to solve #1575 the right way. /David |
here the output of test 1. (
so everything is working as it should here. |
okay. here the output of nr. 2:
|
Looks like it's the colon in the filename. That function is such a kludge. I need to think a bit about how to at least improve it, if not fix it. |
This keeps Idris from crashing on parse errors in absolutely-specified files on Windows. Fixes idris-lang#2317. Kinda.
Steps to reproduce
have a file
test.idr
with this content:module Test a
start the ide-mode in the command line:
idris.exe --ide-mode
load the file into the ide-mode:
00004f((:load-file "C:\Users\Nicolas\Documents\Programming\Idris\Start\test.idr") 1)
the ide-mode responds with (note the same output twice):
and then closes itself with:
idris.exe: src\Idris\Parser.hs:(1276,40)-(1279,67): Non-exhaustive patterns in case
Expected behaviour
It would be nice if the ide-mode would tell me that my inputfile is bogus instead of closing/crashing.
Maybe something like:
(:return (:error (13 1 "insert error message here") [HIGHLIGHTING]))
The text was updated successfully, but these errors were encountered: