cursive
cursive copied to clipboard
Unable to select aliases when importing deps project
When importing a deps project, sometimes it's necessary to select an alias for the project to even resolve correctly. This can happen when using :override-deps or :default-deps. Without the alias applied, the project is essentially invalid and will not resolve. Cursive should probably present the aliases during project import so that the user can select them for the first project resolution.
One minimal reproducer:
mkdir -p project/foo project/bar
echo '{:deps {}}' > project/bar/deps.edn
echo '{:deps {bar {}} :aliases {:default {:override-deps {bar {:local/root "../bar"}}}}}' > project/foo/deps.edn
(Other variants: use :deps {bar nil}, use :default-deps, define the :default alias in a $CLJ_CONFIG-accessible file instead of foo's deps.edn.)
If the default alias is unchecked in the clojure deps tool window, you will get this error when importing or syncing:
Coordinate type not loaded for library bar/bar in coordinate {}
If the default alias is checked, you get a different error:
Manifest type not detected when finding deps for bar/bar in coordinate {:local/root "../bar"}
clojure -Stree -A:default from foo works
A workaround for the "Manifest type not detected" error is explicitly note the manifest type in your :default-deps or :override-deps, e.g. {:default-deps {bar {:local/root "../bar" :deps/manifest :deps}}}
The approach that I've taken for this differs from what I expected to do. I had planned to show the available aliases during import and allow them to be selected, but this doesn't work with the quick project import which doesn't show a UI. So what I have done is to allow the invalid project to be imported, but ensure that the project's aliases are shown in the deps tool window even if the project resolution fails, which means the alias can be selected and the project refreshed to fix the problem.
Fix released in 1.13.1-eap1 on 2023-07-24.
Fix released in 1.13.1 on 2023-12-07.