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

Rename doesn't work for classOf #2681

Closed
chessman opened this issue Apr 5, 2021 · 2 comments
Closed

Rename doesn't work for classOf #2681

chessman opened this issue Apr 5, 2021 · 2 comments
Labels
bug Something that is making a piece of functionality unusable rename semanticdb Related to semanticdb usage in Metals upstream-fix-needed Waiting on a fix upstream

Comments

@chessman
Copy link

chessman commented Apr 5, 2021

  case class Test(s: String)
  val a = classOf[Test]

To Reproduce

Case 1:

  1. Try to rename the case class.
  2. Result: the case class is renamed, classOf[Test] is not renamed.

Case 2:

  1. Try to rename "Test" in classOf.
  2. Result: emacs shows a message "'lsp-rename' is invalid here".

Expected behavior

The class inside classOf is also renamed.

Installation:

  • Operating system: Linux
  • Editor: Emacs
  • Metals version: v0.10.0
  • Scala: 2.12.13
@tgodzik
Copy link
Contributor

tgodzik commented Apr 6, 2021

Thanks for reporting! This is caused by scalameta/scalameta#1909

We've put some time into figuring that one out, but seems we need to fix it in the compiler itself.

@tgodzik tgodzik added bug Something that is making a piece of functionality unusable semanticdb Related to semanticdb usage in Metals upstream-fix-needed Waiting on a fix upstream rename labels Apr 6, 2021
@tgodzik tgodzik added this to the Metals v1.0.0 milestone Apr 9, 2021
@tgodzik tgodzik removed this from the Metals v1.0.0 milestone Aug 18, 2021
@tgodzik
Copy link
Contributor

tgodzik commented Mar 11, 2022

This is now working and there us a test for it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something that is making a piece of functionality unusable rename semanticdb Related to semanticdb usage in Metals upstream-fix-needed Waiting on a fix upstream
Projects
None yet
Development

No branches or pull requests

2 participants