Open rvs314 opened 4 months ago
I get something similar with my setup.
ipkg file:
package display
-- Display
-- by FFFluoride
opts = ""
sourcedir = "src"
modules = Display.Old
, Display.New
, Main
My source tree looks like this:
Everything builds when I load the REPL:
But I get weird error marks:
edit: Everything works except the highlighting so it isn't a huge issue or anything
We are getting closer to fix this although there is still some weird behaviour that I don't understand yet.
Cold start of Idris2 by loading test/src/Main.idr
works correctly as at the beginning we also set the correct working directory.
What puzzles me is that after making the Main.idr
file dirty and trying to load it again we get the error
Source file "Main.idr" is not in the source directory "/home/m/work/idris/frombus/test/src
.
But actually seems like Idris itself changed the working directory to /home/m/work/idris/frombus/test
This creates mismatch between working directory of the idris-mode stored in idris-process-current-working-directory
and Idris working directory.
Here are relevant logs for later investigation:
23:39:12 -> ((:interpret ":cd \"/home/m/work/idris/frombus/test/src\"")
112)
23:39:12 <- (:return
(:ok "Current working directory is \"/home/m/work/idris/frombus/test/src\"")
112)
23:39:12 -> ((:load-file "Main.idr")
113)
23:39:12 <- (:write-string "1/1: Building Main (src/Main.idr)" 113)
23:39:20 -> ((:interpret ":cwd")
116)
23:39:20 <- (:return
(:ok "Current working directory is \"/home/m/work/idris/frombus/test\"")
116)
23:39:36 -> ((:load-file "Main.idr")
117)
23:39:36 <- (:return
(:error "Error: Source file \"Main.idr\" is not in the source directory \"/home/m/work/idris/frombus/test/src\"")
117)
When opening a nested package (a package defined within another package), idris-mode can't seem to find the outer package, as idris itself can. When trying to run test code from the REPL, I get the following error:
The complete file tree looks like this:
I happened to use pack to generate this project scaffold, but I don't think its the cause of the issue.
Here are the contents of the relevant files:
When I open
src/Frombus.idr
, everything works fine. However, when I opentest/src/Main.idr
and executeidris-load-file
, the error is reported.I'm not totally sure, but I think it's a bug in the emacs major mode rather than idris. I can build and run the tests (either by hand or through pack), can find
frombus
as an available package when I runidris2 --list-packages
, and can runidris2 --repl test/test.ipkg
without issue.