-
Notifications
You must be signed in to change notification settings - Fork 71
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
Extract regexp for .ipkg sourcedir option to constant and update the regexp to include also double quotes. #627
Conversation
update the regexp to include also double quotes. Why: In Idris2 the sourcedir option has double quotes. Relates to: idris-hackers#624
@keram thanks for this! I see that the tests are failing, and acknowledge that this is not an issue with this PR. I will look to address the failing tests the now, and will merge your PR. Thanks! |
With idris2, this seems to be causing an error:
for me and a couple of other users on discord. Reverting to the previous commit, aa580b6, resolves the regression. This is happening for a pack-generated project, loading |
@dunhamsteve thanks for highlighting this issue. I have reverted the regexp in a separate PR (i like the extraction). The reason this was not being discovered in our tests is that our tests to do cover loading projects with source dirs. The test suite is lightweight afterall. I tried reproducing the error as a test in ert, alas I could not do so. In the interest of a working version on melpa, I reverted the new regexp. |
Hi @dunhamstev @jfdm Said that I started also working on improving handling of "working dir", "source dir", "ipkg |
I think that error message was the version you get when there actually is an additional Two distinct regular expressions were merged in the PR. One allowed It looks like, when loading a file, Idris will set the current working directory to the directory containing the appropriate .ipkg file. And I think it then expects the filename to be relative to the ipkg. (Although it also seems to accept absolute path names.) That's line 1040 of If we didn't want to change Idris, we could try loading an absolute path. It seems to work at the REPL. Otherwise, it might work to prepare a path relative to the appropriate .ipkg file, and change the working directory to the ipkg directory before loading an ipkg relative path. If we do change Idris, we'll have to figure out what breaks when the current working directory is not changed to the package root and fix it. (Double checking LSP and non-lsp editor modes - I think vim is the only one.) |
Will check but I'm not aware of this.
Yes, previously we had 2 different RegExp-s used in two different contexts
Good point that once we removed the duplication using the one with
Exactly! idris-mode & ipkg file is kind of working with the "incorrect Idris2 implementation"
Idris2 ipkg file
This is good and I think also that in Idris2 is better distinction
Will update later which part I identified that may need to be improved. (have that on different computer)
Funnily that is a workaround in my idris-mode devel branch I used
Once the idris-mode started detecting correctly the
My proposal and direction I'm working on is:
(Having the correct regexp enables another functionalities in the ide-mode and Emacs )
|
"source dir" and "relative file path" or "work dir" and "relative file path" when idris protocol version is greater than 1. Why: In Idris2 the files are loaded relative to work directory which is a directory containing an ".ipkg" file. Relates to: idris-lang/Idris2#3310 idris-hackers#627
"source dir" and "relative file path" or "work dir" and "relative file path" when idris protocol version is greater than 1. Why: In Idris2 the files are loaded relative to work directory which is a directory containing an ".ipkg" file. Relates to: idris-lang/Idris2#3310 idris-hackers#627
"source dir" and "relative file path" or "work dir" and "relative file path" when idris protocol version is greater than 1. Why: In Idris2 the files are loaded relative to work directory which is a directory containing an ".ipkg" file. Relates to: idris-lang/Idris2#3310 idris-hackers#627
"source dir" and "relative file path" or "work dir" and "relative file path" when idris protocol version is greater than 1. Why: In Idris2 the files are loaded relative to work directory which is a directory containing an ".ipkg" file. Relates to: idris-lang/Idris2#3310 idris-hackers#627
Why:
In Idris2 the sourcedir option has double quotes.
Relates to:
#624
It seems to resolve the second reported issue of flycheck reporting issue "Module name X does not match file Y"