Skip to content

Commit

Permalink
fix: report error only on an empty definition
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Jan 24, 2025
1 parent 8168b51 commit 4b6c358
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,10 @@ final class DefinitionProvider(
if (path.isScalaFilename) {
compilers()
.definition(params, token)
.map(reportBuilder.setCompilerResult)
.map {
case res if res.isEmpty => Some(res)
case res if res.isEmpty =>
reportBuilder.setCompilerResult(res)
Some(res)
case res =>
val pathToDef = res.locations.asScala.head.getUri.toAbsolutePath
Some(
Expand Down Expand Up @@ -582,7 +583,7 @@ class DefinitionProviderReportBuilder(

def build(): Option[Report] =
compilerDefn match {
case Some(compilerDefn) if !foundScalaDocDef =>
case Some(compilerDefn) if !foundScalaDocDef && compilerDefn.isEmpty =>
Some(
Report(
"empty-definition",
Expand Down

0 comments on commit 4b6c358

Please sign in to comment.