Skip to content

Commit

Permalink
Don't show extra applies for non-type-forwarder vals
Browse files Browse the repository at this point in the history
  • Loading branch information
rochala committed Apr 12, 2024
1 parent adde393 commit bc7c848
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -238,7 +238,9 @@ class Completions(
.filter(_.symbol.isAccessibleFrom(denot.info))
constructors -> true

else if shouldAddSnippet && completionMode.is(Mode.Term) && sym.name.isTermName && !sym.is(Flags.Method) && !sym.is(Flags.JavaDefined) then
else if shouldAddSnippet && completionMode.is(Mode.Term) && sym.name.isTermName &&
!sym.is(Flags.JavaDefined) && (sym.isClass || sym.is(Module) || (sym.isField && denot.info.isInstanceOf[TermRef])) then

val constructors = if sym.isAllOf(ConstructorProxyModule) then
sym.companionClass.info.member(nme.CONSTRUCTOR).allSymbols
else
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,6 @@ class CompletionDocSuite extends BaseCompletionSuite:
| }
|}
""".stripMargin,
"""|myNumbers(i: Int): Int
|myNumbers: Vector[Int]
"""|myNumbers: Vector[Int]
|""".stripMargin
)
Original file line number Diff line number Diff line change
Expand Up @@ -1627,8 +1627,7 @@ class CompletionSuite extends BaseCompletionSuite:
| val fooBar = List(123)
| foo@@
|""".stripMargin,
"""|fooBar(n: Int): Int
|fooBar: List[Int]
"""|fooBar: List[Int]
|""".stripMargin
)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,6 @@ class CompletionWorkspaceSuite extends BaseCompletionSuite:
|}
|""".stripMargin,
"""|fooBar: String
|fooBar(n: Int): Int - test.A
|fooBar: List[Int]
|""".stripMargin,
)
Expand Down

0 comments on commit bc7c848

Please sign in to comment.