@@ -298,7 +298,7 @@ import transform.SymUtils._
298
298
val maxDist = 3 // maximal number of differences to be considered for a hint
299
299
val missing = name.show
300
300
301
- // The names of all non-synthetic, non-private members of `site`
301
+ // The symbols of all non-synthetic, non-private members of `site`
302
302
// that are of the same type/term kind as the missing member.
303
303
def candidates : Set [Symbol ] =
304
304
for
@@ -323,13 +323,13 @@ import transform.SymUtils._
323
323
else (dist(j - 1 )(i) min dist(j)(i - 1 ) min dist(j - 1 )(i - 1 )) + 1
324
324
dist(s2.length)(s1.length)
325
325
326
- // A list of possible candidate strings with their Levenstein distances
326
+ // A list of possible candidate symbols with their Levenstein distances
327
327
// to the name of the missing member
328
328
def closest : List [(Int , Symbol )] = candidates
329
329
.toList
330
- .map(n => (distance(n .name.show, missing), n ))
331
- .filter((d, n ) => d <= maxDist && d < missing.length && d < n .name.show.length)
332
- .sortBy((d, n ) => (d, n .name.show)) // sort by distance first, alphabetically second
330
+ .map(sym => (distance(sym .name.show, missing), sym ))
331
+ .filter((d, sym ) => d <= maxDist && d < missing.length && d < sym .name.show.length)
332
+ .sortBy((d, sym ) => (d, sym .name.show)) // sort by distance first, alphabetically second
333
333
334
334
val enumClause =
335
335
if ((name eq nme.values) || (name eq nme.valueOf)) && site.classSymbol.companionClass.isEnumClass then
@@ -348,14 +348,14 @@ import transform.SymUtils._
348
348
val finalAddendum =
349
349
if addendum.nonEmpty then prefixEnumClause(addendum)
350
350
else closest match
351
- case (d, n ) :: _ =>
351
+ case (d, sym ) :: _ =>
352
352
val siteName = site match
353
353
case site : NamedType => site.name.show
354
354
case site => i " $site"
355
355
val showName =
356
356
// Add .type to the name if it is a module
357
- if n.isClass && n. is(Module ) then s " ${n .name.show}.type "
358
- else n .name.show
357
+ if sym. is(ModuleClass ) then s " ${sym .name.show}.type "
358
+ else sym .name.show
359
359
s " - did you mean $siteName. $showName? $enumClause"
360
360
case Nil => prefixEnumClause(" " )
361
361
0 commit comments