Skip to content

Comments

Add imports on paste#8181

Open
mkoteckivl wants to merge 2 commits intoscalameta:main-v2from
mkoteckivl:add_imports_on_paste_v2
Open

Add imports on paste#8181
mkoteckivl wants to merge 2 commits intoscalameta:main-v2from
mkoteckivl:add_imports_on_paste_v2

Conversation

@mkoteckivl
Copy link

based mostly on PR#7542

@coderabbitai
Copy link

coderabbitai bot commented Feb 10, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for raising this!

* Convert a semanticdb symbol to an import path.
* E.g., "scala/collection/immutable/List#" -> "scala.collection.immutable.List"
*/
private def symbolToFqcn(symbol: String): String = {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think most of this got rewritten and replaced on main. The logic was flaky unfortunately, could you check the newest version instead?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've applied newer changes from the main branch.

import org.eclipse.lsp4j.DiagnosticSeverity

object DiagnosticsProvider {
def getDiagnostics(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't we already return compiler diagnostics for Metals 2? I think we don't need to add this.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, we probably don't need it, I've removed it.

params.token()
) { pc =>
val compiler = pc.compiler(params)
if (params.shouldReturnDiagnostics()) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you check if there is nothing in m2 that already handles the diagnostics? Should probably be do on didChange, maybe we can use the same approach

Copy link
Contributor

@tgodzik tgodzik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you look at the failing tests? Also scalafix and scalafmt is failing. You can just run both sbt scalafixAll and './bin/scalafmt'

@mkoteckivl mkoteckivl force-pushed the add_imports_on_paste_v2 branch 2 times, most recently from 21cf195 to cfb46a3 Compare February 18, 2026 13:20
@mkoteckivl mkoteckivl force-pushed the add_imports_on_paste_v2 branch from cfb46a3 to 9c96546 Compare February 20, 2026 13:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants