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

completions: do not complete package #20532

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dos65
Copy link
Contributor

@dos65 dos65 commented Jun 7, 2024

There is an issue with completions for package in Metals.

// code
package one@@
// compeltions
oneCURSOR

It seems there is no need in completions for Package at all.

There is an issue with completions for package in Metals.

```scala
// code
package one@@
// compeltions
oneCURSOR
```

It seems there is no need in completions for Package at all.
@dos65
Copy link
Contributor Author

dos65 commented Jun 7, 2024

@rochala btw, do you know if it should be backported to metals or not?

@rochala
Copy link
Contributor

rochala commented Jun 7, 2024

Hey, so the situation is as follows.

Short answer: there is no need

Long answer: Metals is no longer publishing mtags for >= 3.4.0. We will also stop releasing them for LTS line in the near future (as soon as we backport most of the latest changes to the LTS branch). Hopefully it will be 3.3.4

Copy link
Contributor

@rochala rochala left a comment

Choose a reason for hiding this comment

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

I left small comment

@@ -211,6 +211,8 @@ object Completion:
val completer = new Completer(mode, pos, untpdPath, matches0)

val result = adjustedPath match
// Ignore `package foo@@` and `package foo.bar@@`
case ((_: tpd.Select) | (_: tpd.Ident)):: (_ : tpd.PackageDef) :: _ => Map.empty
Copy link
Contributor

Choose a reason for hiding this comment

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

The check is correct, but it may be better to make it in Completion.completionMode instead of this place. The reason is that despite filtering compiler completions, completion mode is also used for the rest of the completions in presentation compiler.

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.

2 participants