-
Notifications
You must be signed in to change notification settings - Fork 339
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
bugfix: don't show scope completions for multi-imports #5994
Conversation
@@ -58,6 +60,7 @@ object CompletionPos: | |||
val kind = | |||
if query.isEmpty && !prevIsDot then CompletionKind.Empty |
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 believe we should check if !prevIsDot && !isImportSelect(cursorPos, treePath)
, so import scala.collection.{AbstractMap, @@}
would work
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.
Where do we check it? Or do you mean we should check it 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.
Yes, I mean we should check it here
def loop(enclosing: List[Tree]): Boolean = | ||
enclosing match | ||
case head :: tl if !head.sourcePos.contains(pos) => loop(tl) | ||
case Import(_, sel) :: _ => |
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.
Should this work in Export also?
@@ -58,6 +60,7 @@ object CompletionPos: | |||
val kind = | |||
if query.isEmpty && !prevIsDot then CompletionKind.Empty |
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.
Where do we check it? Or do you mean we should check it 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.
lgtm
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!
This includes: - scalameta/metals#5956 - scalameta/metals#5979 - scalameta/metals#5994 - scalameta/metals#5995 - scalameta/metals#5998 - scalameta/metals#5999 - scalameta/metals#6000 [Cherry-picked 7240327]
resolves: #5991