Skip to content

Commit

Permalink
filter if empty locations
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed May 9, 2024
1 parent 3c51994 commit 0368fc4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -219,17 +219,19 @@ final class ReferenceProvider(
.map(
_.flatten
.groupBy(_.symbol)
.map { case (symbol, refs) =>
ReferencesResult(symbol, refs.flatMap(_.locations))
.collect {
case (symbol, refs) if refs.exists(_.locations.nonEmpty) =>
ReferencesResult(symbol, refs.flatMap(_.locations))
}
.toList
)
case None =>
scribe.debug(s"No semanticdb for $source")
pcReferences(source, params).map(
_.groupBy(_.symbol)
.map { case (symbol, refs) =>
ReferencesResult(symbol, refs.flatMap(_.locations))
.collect {
case (symbol, refs) if refs.exists(_.locations.nonEmpty) =>
ReferencesResult(symbol, refs.flatMap(_.locations))
}
.toList
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import org.eclipse.lsp4j.jsonrpc.messages.{Either => JEither}
case class PcReferencesRequest(
file: VirtualFileParams,
includeDefinition: Boolean,
offsetOrSymbol: JEither[Integer, String],
offsetOrSymbol: JEither[Integer, String]
) extends ReferencesRequest

case class PcReferencesResult(
Expand Down

0 comments on commit 0368fc4

Please sign in to comment.