@@ -36,7 +36,7 @@ import org.eclipse.lsp4j.TextEdit
36
36
* A type printer that shortens types by replacing fully qualified names with shortened versions.
37
37
*
38
38
* The printer supports symbol renames found in scope and will use the rename if it is available.
39
- * It also handlse custom renames as specified in the `renameConfigMap` parameter.
39
+ * It also handle custom renames as specified in the `renameConfigMap` parameter.
40
40
*/
41
41
class ShortenedTypePrinter (
42
42
symbolSearch : SymbolSearch ,
@@ -45,7 +45,7 @@ class ShortenedTypePrinter(
45
45
isTextEdit : Boolean = false ,
46
46
renameConfigMap : Map [Symbol , String ] = Map .empty
47
47
)(using indexedCtx : IndexedContext , reportCtx : ReportContext ) extends RefinedPrinter (indexedCtx.ctx):
48
- private val missingImports : mutable.Set [ImportSel ] = mutable.Set .empty
48
+ private val missingImports : mutable.Set [ImportSel ] = mutable.LinkedHashSet .empty
49
49
private val defaultWidth = 1000
50
50
51
51
private val methodFlags =
@@ -62,9 +62,9 @@ class ShortenedTypePrinter(
62
62
AbsOverride ,
63
63
Lazy
64
64
)
65
-
66
- private val foundRenames = collection.mutable.Map .empty[Symbol , String ]
67
-
65
+
66
+ private val foundRenames = collection.mutable.LinkedHashMap .empty[Symbol , String ]
67
+
68
68
def getUsedRenamesInfo (using Context ): List [String ] =
69
69
foundRenames.map { (from, to) =>
70
70
s " type $to = ${from.showName}"
@@ -190,7 +190,7 @@ class ShortenedTypePrinter(
190
190
191
191
override protected def selectionString (tp : NamedType ): String =
192
192
indexedCtx.rename(tp.symbol) match
193
- case Some (value) =>
193
+ case Some (value) =>
194
194
foundRenames += tp.symbol -> value
195
195
value
196
196
case None => super .selectionString(tp)
0 commit comments