metals icon indicating copy to clipboard operation
metals copied to clipboard

Completions showing private members

Open vzmerr opened this issue 2 years ago • 1 comments

Describe the bug

Metals sometimes shows private members as completions for Scala 2, such as

ProcessBuilderImpl - scala.sys.process in this test:

https://github.com/scalameta/metals/blob/main/tests/cross/src/test/scala/tests/pc/CompletionSuite.scala#L356

Expected behavior

Private members that are not in scope should not be suggested as completion.

Operating system

No response

Editor/Extension

No response

Version of Metals

0.11.7+71-ae60fa38-SNAPSHOT

Extra context or search terms

This problem currently does not seem to exist for the suggested Scala 3 completions.

vzmerr avatar Jul 31 '22 13:07 vzmerr

It seems that after allowing objects in type and new positions as in https://github.com/scalameta/metals/pull/4224, the issue appeared also for Scala 3. So the main problem is to filter out the private members. both for Scala 2 and 3.

vzmerr avatar Aug 04 '22 14:08 vzmerr