-
Notifications
You must be signed in to change notification settings - Fork 326
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
Keep modifiers when implementing abstract members #1762
Keep modifiers when implementing abstract members #1762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for taking a look at it! I think it's almost ready, but I left some comments
@@ -213,6 +213,16 @@ trait OverrideCompletions { this: MetalsGlobal => | |||
if (sym.isLazy) "lazy " | |||
else "" | |||
|
|||
val _modifs = sym.flagString | |||
.replace("package ", "") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we need to do this? We are not doing overrides for any of those symbol types.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure if this is a bug or intended behaviour but flagString generates modifiers like protected[package x.y.z] and they need to be stripped manually.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about object
, trait
or class
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handled already
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I meant, does those keywords can appear here even? You mentioned protected[package x.y.z]
, but why would trait appear here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scala> trait A {
| trait AB {
| private[A] val x = 3
| }
| }
trait A
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We could do:
val _modifs =
sym.flagString.replace(
sym.privateWithin.toString(),
sym.privateWithin.name.toString()
)
mtags/src/main/scala-2/scala/meta/internal/pc/completions/OverrideCompletions.scala
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Fixes #1759
Not sure if this is a bug or intended behaviour but
flagString
generates modifiers likeprotected[package x.y.z]
and they need to be stripped manually.