-
Notifications
You must be signed in to change notification settings - Fork 332
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
Quick fix "Import" does not work for modifier private with access qualifier #6732
Comments
Has anyone started looking at this one yet? If not, I'd be happy to take a look at this. |
I don't think anyone had the time, so you're welcome to take a look. Some places to take a look at: This one is used for the auto imports code action. We used this one to get members to import found from indexing via metals.
Here we provide the potential matches |
Thanks @tgodzik! I believe I've found in the code where symbols are being filtered by visibility. It looks like something similar is done in the scala 3 implementation. I'll have to have a deeper look into the scala reflection documentation (I can start with scala 2 if that's OK with you) to get a better sense on how to get the "access" modifier from a |
Actually, this might be as simple as doing You could just try that with some tests for good measure. |
Discussed in #6730
Originally posted by LeUser111 August 28, 2024
Hi there,
I'm making massive use of access modifiers in combination with access qualifiers (see Scala 2 language specification) throughout my code bases.
Unfortunately, metals does not suggest imports for members with modifier private and matching qualifier.
A simple example would be:
The import quick fix works perfectly fine when A is public. Right now this means that I have to write a lot of imports by hand. It would be really nice if metals could suggest the imports automatically!
I'm not sure if this would be a bug or feature request and whether metals is even the right project - it might be an upstream issue.
I'd be grateful if someone could point me in the right direction!
The text was updated successfully, but these errors were encountered: