Skip to content

completions: do not complete package #20532

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

Merged
merged 1 commit into from
Feb 28, 2025
Merged

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.

@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.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@tgodzik
Copy link
Contributor

tgodzik commented Feb 18, 2025

@dos65 this should be close to finishing, do you want still do it?

@dos65
Copy link
Contributor Author

dos65 commented Feb 18, 2025

@tgodzik oops sorry, I totally forgot about it 😅

will do it asap

@tgodzik
Copy link
Contributor

tgodzik commented Feb 18, 2025

No worries and no hurry! I closed an another older PR of yours, but that one might have needed a total rework, so I figured that it might not make sense to keep it open

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 dos65 force-pushed the fix_package_cursor branch from 49408b1 to 7c76ded Compare February 27, 2025 18:46
@dos65
Copy link
Contributor Author

dos65 commented Feb 27, 2025

@rochala @tgodzik I did it 😺
Could you take a look?

Copy link
Member

@kasiaMarek kasiaMarek left a comment

Choose a reason for hiding this comment

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

LGTM

@tgodzik tgodzik merged commit ed2f0ad into scala:main Feb 28, 2025
29 checks passed
@WojciechMazur WojciechMazur added this to the 3.7.0 milestone Mar 11, 2025
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.

5 participants