-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
isPublic method throwing an exception #16175
Comments
It seems that it can sometimes throw an exception, which will make no completions show up for example in some scope completions in metals codebase. Related to scala/scala3#16175
It seems that it can sometimes throw an exception, which will make no completions show up for example in some scope completions in metals codebase. Related to scala/scala3#16175
Yeah, there's where the bug is: the shading rewrote a bunch of fully qualified references in the bytecode, but not in the scala 2 pickle. I'm not sure how many "wait, but what if the pickle is wrong" checks we want to put in the scala 2 unpickler, as a workaround for broken shading.
isPublic is just triggering things to run, that are only run lazily. It's the reality of lazy execution, which isn't common, so that can be unexpected. |
Shouldn't we at least wrap that the problematic part in a try? It's not something we can sensibly handle on our own. |
Also for:
compilation fails. So currently it's not possible to use shaded libraries, which might be a legitimate restriction, but wanted to confirm. |
Do you mean wrap in the compiler? How do we handle it? What should
Sounds right to me. |
coursier-interface uses jarjar-abrams, which should also process picking annotations. But maybe its picking annotation processing capabilities are too limited? |
It seems that it can sometimes throw an exception, which will make no completions show up for example in some scope completions in metals codebase. Related to scala/scala3#16175
…sspath We previously fixed another issue connected to this, when no completions would be available because `isPublic` would throw an exception. Now, it turns out we needed to wrap `toSymbols` methods, otherwise we would not get the duplicated symbols (which are also shadowed) Connected to scala/scala3#16175
…sspath We previously fixed another issue connected to this, when no completions would be available because `isPublic` would throw an exception. Now, it turns out we needed to wrap `toSymbols` methods, otherwise we would not get the duplicated symbols (which are also shadowed) Connected to scala/scala3#16175
…sspath We previously fixed another issue connected to this, when no completions would be available because `isPublic` would throw an exception. Now, it turns out we needed to wrap `toSymbols` methods, otherwise we would not get the duplicated symbols (which are also shadowed) Connected to scala/scala3#16175
…sspath We previously fixed another issue connected to this, when no completions would be available because `isPublic` would throw an exception. Now, it turns out we needed to wrap `toSymbols` methods, otherwise we would not get the duplicated symbols (which are also shadowed) Connected to scala/scala3#16175
Compiler version
3.2.1-RC2
Minimized code
When Metals used the compiler it tries to load some symbols for classfiles to get automatic imports for symbols.
It seems there is an issue with shaded scala collection classfiles inside coursierapi.
Most likely happening in this piece of code:
https://github.com/scalameta/metals/blob/main/mtags/src/main/scala-3/scala/meta/internal/pc/CompilerSearchVisitor.scala
Is it something we are doing or an issue with the compiler? Anyway I wouldn't expect
isPublic
method to throw an exception.Output
Looks related to #2809
Expectation
No exception is thrown.
The text was updated successfully, but these errors were encountered: