Closed alternateved closed 1 year ago
After a bit of digging it seems that evaluating this:
(expand-file-name exercism--current-exercise track-dir)
from https://github.com/anonimitoraf/exercism.el/blob/main/exercism.el#L152 yields (wrong-type-argument stringp nil)
error so apparently exercism--current-exercise
is not set.
Hello @alternateved, thanks for reporting. I'll have a look this afternoon
Thanks a lot! If this is any helpful, I've encountered this error while submitting exercise from Scheme path.
Thanks, that's useful to know. I'll try out Scheme myself (maybe exercises there are configured differently)
Weird, seems fine to me. Do you have the latest version of exercism.el
?
https://github.com/anonimitoraf/exercism.el/assets/15933322/1b1bbd23-ebe8-4aaa-bb1c-842491317ddb
Hmm... For sure. But my exercism
binary might be outdated. Currently I'm on 3.1.0
. Let me test the latest version.
I'm on exercism version 3.1.0
too (MacOS). Actually, I wonder if there's some sort of race condition.
Do you get the error all the time? Or just intermittently?
I have purged ../emacs/elpa
and ../emacs/eln-cache
directories, recompiled everything and upgraded exercism
binary to 3.2.0
. And now I get entirely different error:
I see. What does this output? ls -alR /var/home/alternateved/exercism/scheme/hello-world
(Pardon any typos)
~ $ ls -alR /var/home/alternateved/exercism/scheme/hello-world
"/var/home/alternateved/exercism/scheme/hello-world": No such file or directory (os error 2)
~ $ ls -alR /var/home/alternateved/Code/exercism/scheme/hello-world
drwxr-xr-x@ - alternateved 21 Aug 12:41 .exercism
.rw-r--r--@ 56 alternateved 21 Aug 12:41 hello-world.scm
.rw-r--r--@ 1.4k alternateved 21 Aug 12:41 HELP.md
.rw-r--r--@ 235 alternateved 21 Aug 12:41 Makefile
.rw-r--r--@ 2.0k alternateved 21 Aug 12:41 README.md
.rw-r--r--@ 5.9k alternateved 21 Aug 12:41 test-util.ss
.rw-r--r--@ 171 alternateved 21 Aug 12:41 test.scm
/var/home/alternateved/Code/exercism/scheme/hello-world/.exercism:
.rw-r--r--@ 584 alternateved 21 Aug 12:41 config.json
.rw-------@ 213 alternateved 21 Aug 12:41 metadata.json
Ah, it checks wrong directory!
Contents of my ~/.config/exercism/user.json
:
{
"apibaseurl": "https://api.exercism.io/v1",
"token": "MY_TOKEN",
"workspace": "/var/home/alternateved/Code/exercism"
}
It might seem that currently exercism.el
ignores custom workspace. Btw. previous version of exercism--submit
works without issues:
(defun exercism--submit (&optional open-in-browser-after?)
"Submits your solution in the current directory.
If OPEN-IN-BROWSER-AFTER? is non-nil, the browser's opened for
you to complete your solution."
(exercism--run-shell-command (format "%s submit" (shell-quote-argument exercism-executable))
(lambda (result)
(message "[exercism] submit: %s" result)
;; Result looks something like:
;; Your solution has been submitted successfully.
;; View it at:
;;
;;
;; https://exercism.org/tracks/javascript/exercises/hello-world
(when open-in-browser-after?
(when (string-match "\\(https://exercism\\.org.*\\)" result)
(browse-url (match-string 1 result)))
(message "[exercism] submit: %s" result)))))
If I move exercism
directory into ~/
then latest version of exercism-submit
(807ad7c9889b5a774f34ad65c6de0d40d74f253f) works.
Ah! I didn't know about custom workspaces! I'll support it tomorrow.
Btw. previous version of exercism--submit works without issues
I think only for some languages. See https://github.com/anonimitoraf/exercism.el/issues/4 (.clj
for example has src/solution.clj
, C/C++ have header files as well as source files, so I think the foolproof way to make it work for all of them is to parse config.json
)
If you are blocked in the meantime, feel free to use the previous version
Ah, that makes sense! Thank you for all your work and thanks for great package.
Hi @alternateved do you mind trying https://github.com/anonimitoraf/exercism.el/pull/6 ? I only tried it out on Mac. Let me know if you encounter any issues!
Hello @anonimitoraf! After running exercism-configure
everything seems to work great. Thanks!
I've tested the latest version from MELPA and everything works. Thanks a lot for your help @anonimitoraf!
No worries!
Hello!
It seems that after latest changes (https://github.com/anonimitoraf/exercism.el/commit/807ad7c9889b5a774f34ad65c6de0d40d74f253f)
exercism-submit
doesn't work anymore.Error that I get is:
exercism-submit: Wrong type argument: stringp, nil
Emacs version:GNU Emacs 29.1 (build 1, x86_64-redhat-linux-gnu, GTK+ Version 3.24.38, cairo version 1.17.8) of 2023-08-07
.