Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Allow user to choose what symbol to search for in go to references #6676

Draft
wants to merge 2 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading