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 20, 2024
1 parent fcb65af commit daca5d6
Show file tree
Hide file tree
Showing 17 changed files with 408 additions and 111 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 daca5d6

Please sign in to comment.