File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
compiler/src/dotty/tools/dotc/semanticdb Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change @@ -319,9 +319,14 @@ class ExtractSemanticDB extends Phase:
319
319
registerSymbol(sym, symkinds)
320
320
321
321
private def namePresentInSource (sym : Symbol , span : Span , source: SourceFile )(using Context ): Boolean =
322
- val content = source.content()
323
- val (start, end) = if content(span.end - 1 ) == '`' then (span.start + 1 , span.end - 1 ) else (span.start, span.end)
324
- content.slice(start, end).mkString == sym.name.stripModuleClassSuffix.lastPart.toString
322
+ if ! span.exists then false
323
+ else
324
+ val content = source.content()
325
+ val (start, end) =
326
+ if content.lift(span.end - 1 ).map(_ == '`' ).getOrElse(false ) then
327
+ (span.start + 1 , span.end - 1 )
328
+ else (span.start, span.end)
329
+ content.slice(start, end).mkString == sym.name.stripModuleClassSuffix.lastPart.toString
325
330
326
331
private def spanOfSymbol (sym : Symbol , span : Span , treeSource : SourceFile )(using Context ): Span =
327
332
val contents = if treeSource.exists then treeSource.content() else Array .empty[Char ]
You can’t perform that action at this time.
0 commit comments