Skip to content

Commit

Permalink
chore: Fix nightlies after recent changes (#4312)
Browse files Browse the repository at this point in the history
The issues caused by scala/scala3#15877
  • Loading branch information
tgodzik authored and dos65 committed Sep 5, 2022
1 parent 495ecd7 commit 4de7bd8
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -248,9 +248,14 @@ object MetalsInteractive:
target.sourcePos.contains(pos) =>
List((target.symbol, target.typeOpt))

case path @ head :: tl =>
case path @ head :: tail =>
if head.symbol.is(Synthetic) then
enclosingSymbolsWithExpressionType(tl, pos, indexed, skipCheckOnName)
enclosingSymbolsWithExpressionType(
tail,
pos,
indexed,
skipCheckOnName,
)
else if head.symbol != NoSymbol then
if skipCheckOnName ||
MetalsInteractive.isOnName(
Expand All @@ -259,12 +264,18 @@ object MetalsInteractive:
indexed.ctx.source,
)
then List((head.symbol, head.typeOpt))
/* Type tree for List(1) has an Int type variable, which has span
* but doesn't exist in code.
* https://github.com/lampepfl/dotty/issues/15937
*/
else if head.isInstanceOf[TypeTree] then
enclosingSymbolsWithExpressionType(tail, pos, indexed)
else Nil
else
val recovered = recoverError(head, indexed)
if recovered.isEmpty then
enclosingSymbolsWithExpressionType(
tl,
tail,
pos,
indexed,
skipCheckOnName,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -290,6 +290,8 @@ class CompletionKeywordSuite extends BaseCompletionSuite {
|""".stripMargin,
"""|return
|""".stripMargin,
// methods add in 3.2.1
filter = item => !item.contains("retains"),
)

check(
Expand All @@ -302,6 +304,8 @@ class CompletionKeywordSuite extends BaseCompletionSuite {
|}
|""".stripMargin,
"",
// methods add in 3.2.1
filter = item => !item.contains("retains"),
)

check(
Expand All @@ -319,6 +323,8 @@ class CompletionKeywordSuite extends BaseCompletionSuite {
compat = Map(
"3" -> ""
),
// methods add in 3.2.1
filter = item => !item.contains("retains"),
)

check(
Expand All @@ -329,6 +335,8 @@ class CompletionKeywordSuite extends BaseCompletionSuite {
|ret@@
|""".stripMargin,
"",
// methods add in 3.2.1
filter = item => !item.contains("retains"),
)

check(
Expand Down

0 comments on commit 4de7bd8

Please sign in to comment.