Skip to content

Organizing imports with ...{given Decoder[X]} fails #2255

Open
@adamw

Description

@adamw

Given the following imports:

import io.circe.Json
import io.circe.parser.*
import io.circe.syntax.*
import io.circe.{Decoder, Encoder}
import org.scalatest.flatspec.AnyFlatSpec
import chimp.mcp.JSONRPCMessage.{given Decoder[JSONRPCMessage], given Encoder[JSONRPCMessage]}
import org.scalatest.matchers.should.Matchers

Organizing them yields:

import chimp.mcp.JSONRPCMessage.given Decoder[JSONRPCMessage]
import chimp.mcp.JSONRPCMessage.given Encoder[JSONRPCMessage]
import io.circe.Decoder
import io.circe.Encoder
import io.circe.Json
import io.circe.parser.*
import io.circe.syntax.*
import org.scalatest.flatspec.AnyFlatSpec
import org.scalatest.matchers.should.Matchers

Which is incorrect, since Decoder is imported after the given.

This has been observed in Metals 1.5.3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions