Skip to content
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

Ammonite: Invalid $ivy Import Errors are a bit User Unfriendly #4647

Open
LaurenceWarne opened this issue Nov 17, 2022 · 2 comments
Open

Ammonite: Invalid $ivy Import Errors are a bit User Unfriendly #4647

LaurenceWarne opened this issue Nov 17, 2022 · 2 comments
Labels
ammonite support Ammonite related tickets upstream-fix-needed Waiting on a fix upstream

Comments

@LaurenceWarne
Copy link
Contributor

LaurenceWarne commented Nov 17, 2022

Describe the bug

Very minor, but invalid ivy imports currently spit out the full import tree:
invalid-ivy-import

Expected behavior

I think probably the import text itself would be more user friendly, e.g. Invalid $ivy import: '$ivy.an.invalid.ivyimport'. I had a quick look, and it looks like the error is forwarded from here (?): https://github.com/com-lihaoyi/Ammonite/blob/9be39debc367abad5f5541ef58f4b986b2a8d045/amm/runtime/src/main/scala/ammonite/runtime/ImportHook.scala#L171.

Operating system

Linux

Editor/Extension

Emacs (lsp-metals)

Version of Metals

v0.11.9

Scala Version: 3.2.0 and 2.13.9
Ammonite Version: 2.5.5

Extra context or search terms

No response

@tgodzik
Copy link
Contributor

tgodzik commented Nov 21, 2022

Thanks for reporting! Are you using Scala 3 Ammonite? I think that might be an issue we need to fix upstream in Ammonite.

Import tree doesn't seem to have any toString:
https://github.com/com-lihaoyi/Ammonite/blob/9be39debc367abad5f5541ef58f4b986b2a8d045/amm/util/src/main/scala/ammonite/util/Model.scala#L256

@tgodzik tgodzik added ammonite support Ammonite related tickets upstream-fix-needed Waiting on a fix upstream labels Nov 21, 2022
@LaurenceWarne
Copy link
Contributor Author

Thanks for reporting! Are you using Scala 3 Ammonite?

Just double checked, I can reproduce it with Scala 3 and 2.13.9 (with Ammonite 2.5.5 - I'll add these to the initial report 🙂 )

I think that might be an issue we need to fix upstream in Ammonite.

Yeah I think it looks that way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ammonite support Ammonite related tickets upstream-fix-needed Waiting on a fix upstream
Projects
None yet
Development

No branches or pull requests

2 participants