Skip to content

Commit

Permalink
feat: Allow user to choose what symbol to search for in go to references
Browse files Browse the repository at this point in the history
  • Loading branch information
kasiaMarek committed Aug 19, 2024
1 parent fcb65af commit a7b7997
Show file tree
Hide file tree
Showing 14 changed files with 302 additions and 105 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -1082,6 +1082,9 @@ object Messages {
}
}

final val PickSymbolForReferenceSearch =
"Choose symbol to search references for."

}

object FileOutOfScalaCliBspScope {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ abstract class MetalsLspService(
buildTargets,
compilers,
scalaVersionSelector,
languageClient,
clientConfig.isQuickPickProvider(),
)

protected val packageProvider: PackageProvider =
Expand Down Expand Up @@ -1126,7 +1128,7 @@ abstract class MetalsLspService(
params: ReferenceParams
): Future[List[ReferencesResult]] = {
val timer = new Timer(time)
referencesProvider.references(params).map { results =>
referencesProvider.references(params, isForRename = false).map { results =>
if (clientConfig.initialConfig.statistics.isReferences) {
if (results.forall(_.symbol.isEmpty)) {
scribe.info(s"time: found 0 references in $timer")
Expand Down
Loading

0 comments on commit a7b7997

Please sign in to comment.