idris-hackers / idris-mode

Idris syntax highlighting, compiler-supported editing, interactive REPL and more things for Emacs.
GNU General Public License v3.0
268 stars 70 forks source link

Improve `idris-filename-to-load` to return expected pair of dir and relative path depending on idris-protocol version #634

Open keram opened 2 months ago

keram commented 2 months ago

What:

Make (idris-filename-to-load) to return

Why:

In Idris2 the files are loaded relative to work directory which is a directory containing an ".ipkg" file. This will allow us reintroduce regexp to correctly extract sourcedir value from ipkg file in Idris2.

Relates to: https://github.com/idris-lang/Idris2/issues/3310 https://github.com/idris-hackers/idris-mode/pull/627

jfdm commented 2 months ago

AFAICT, the error is due to flycheck. I am not sure how your changes would have triggered the flycheck eror, I suspect they didn't.

I will run the builds again and hope for the best...

jfdm commented 2 months ago

Ahh, the flycheck things are warnings.

The issue seems to be:

 In toplevel form:
idris-commands.el:1390:1:Error: the function ‘file-name-parent-directory’ is not known to be defined.
make: *** [Makefile:45: idris-commands.elc] Error 1
Error: Process completed with exit code 2.

I wonder if file-name-parent-directory is new for 29.X and we need to be backwards compatible for 27.X and 28.X. (Comparing this and this) shows me that the function is missing)

keram commented 2 months ago

I wonder if file-name-parent-directory is new for 29.X and we need to be backwards compatible for 27.X and 28.X.

Yes, I think we can backport it into ./idris-compat.el . Will update this pull request later this week. I was curious if the pipeline will pass on first try and to catch something like this. Thanks for looking to the draft already ! :)