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

bugfix: don't show scope completions for multi-imports #5994

Merged
merged 2 commits into from
Jan 8, 2024

Conversation

kasiaMarek
Copy link
Contributor

resolves: #5991

@@ -58,6 +60,7 @@ object CompletionPos:
val kind =
if query.isEmpty && !prevIsDot then CompletionKind.Empty
Copy link
Member

@jkciesluk jkciesluk Jan 4, 2024

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

Copy link
Contributor

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?

Copy link
Member

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) :: _ =>
Copy link
Contributor

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
Copy link
Contributor

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?

Copy link
Member

@jkciesluk jkciesluk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Do not show workspace/classpath completions in imports for Scala 3
3 participants