Skip to content

Remove PreName add (almost) all other implicit conversions #4077

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

Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/repl/terminal/Ansi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ object Ansi {
object Str {
@sharable lazy val ansiRegex = "\u001B\\[[;\\d]*m".r

implicit def parse(raw: CharSequence): Str = {
def parse(raw: CharSequence): Str = {
val chars = new Array[Char](raw.length)
val colors = new Array[Short](raw.length)
var currentIndex = 0
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/repl/terminal/Protocol.scala
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ case class TermState(
inputs: LazyList[Int],
buffer: Vector[Char],
cursor: Int,
msg: Ansi.Str = ""
msg: Ansi.Str = Ansi.Str.parse("")
) extends TermAction

object TermState {
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/repl/terminal/Terminal.scala
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ object Terminal {
lazy val ansi = new AnsiNav(writer)
lazy val (width, _, initialConfig) = TTY.init()
try {
readChar(TermState(LazyList.continually(reader.read()), Vector.empty, 0, ""), 0)
readChar(TermState(LazyList.continually(reader.read()), Vector.empty, 0, Ansi.Str.parse("")), 0)
}
finally {

Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dotty/tools/repl/terminal/Utils.scala
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ object FrontEndUtils {
transpose(grouped).iterator.flatMap { group =>
val last = group.last
group.init.map(
x => x ++ " " * (width / columns - x.length)
x => x ++ Ansi.Str.parse(" " * (width / columns - x.length))
) :+ last :+ Ansi.Str.parse(newLine)
}
.map(_.render)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ class HistoryFilter(
searchHistory(historyIndex - 1, -1, b, b)

def wrap(rest: LazyList[Int], out: (Vector[Char], Int, String)) =
TS(rest, out._1, out._2, out._3)
TS(rest, out._1, out._2, Ansi.Str.parse(out._3))

def ctrlR(b: Vector[Char], c: Int) =
if (activeSearch) up(b, c)
Expand Down
10 changes: 5 additions & 5 deletions compiler/src/dotty/tools/repl/terminal/filters/UndoFilter.scala
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ case class UndoFilter(maxUndo: Int = 25) extends DelegateFilter("UndoFilter") {
var undoIndex = 0
/**
* An enum representing what the user is "currently" doing. Used to
* collapse sequential actions into one undo step: e.g. 10 plai
* collapse sequential actions into one undo step: e.g. 10 plai
* chars typed becomes 1 undo step, or 10 chars deleted becomes one undo
* step, but 4 chars typed followed by 3 chars deleted followed by 3 chars
* typed gets grouped into 3 different undo steps
Expand Down Expand Up @@ -147,8 +147,8 @@ object UndoState {
}

object UndoFilter {
val undoMsg = Ansi.Color.Blue(" ...undoing last action, `Alt -` or `Esc -` to redo")
val cannotUndoMsg = Ansi.Color.Blue(" ...no more actions to undo")
val redoMsg = Ansi.Color.Blue(" ...redoing last action")
val cannotRedoMsg = Ansi.Color.Blue(" ...no more actions to redo")
val undoMsg = Ansi.Color.Blue(Ansi.Str.parse(" ...undoing last action, `Alt -` or `Esc -` to redo"))
val cannotUndoMsg = Ansi.Color.Blue(Ansi.Str.parse(" ...no more actions to undo"))
val redoMsg = Ansi.Color.Blue(Ansi.Str.parse(" ...redoing last action"))
val cannotRedoMsg = Ansi.Color.Blue(Ansi.Str.parse(" ...no more actions to redo"))
Copy link
Contributor

Choose a reason for hiding this comment

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

This commit LGTM

Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure about this one.

}