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 Symbol offset error preventing F2 to work in vscode #7161

Open
bjornregnell opened this issue Jan 28, 2025 · 8 comments
Open

Rename Symbol offset error preventing F2 to work in vscode #7161

bjornregnell opened this issue Jan 28, 2025 · 8 comments
Labels
improvement Not a bug or a feature, but something general we can improve

Comments

@bjornregnell
Copy link
Contributor

Describe the bug

  1. Double click on a method name
  2. Press F2
  3. First letter of method name is missing and one paren is included

Image

The "Rename Symbol" feature does not work then... (But F12 "Goto definition" still works)

Here is a dump of Metals Doctor:

Image

Here is the build.sbt:
https://github.com/reqT/reqT/blob/4.x/build.sbt

Expected behavior

The method name should be properly marked in the rename popup.

Operating system

Linux

Editor/Extension

VS Code

Version of Metals

v1.5.1

Extra context or search terms

No response

@tgodzik
Copy link
Contributor

tgodzik commented Jan 28, 2025

Thanks for reporting! I can't seem to reproduce, it might have been flaky, but in those cases we usually don't rename. Are you able to still reproduce?

Screencast.from.2025-01-28.11-45-43.mp4

@tgodzik tgodzik added the needs more information Use if we need more information for a specific ticket label Jan 28, 2025
@bjornregnell
Copy link
Contributor Author

bjornregnell commented Jan 28, 2025

I did a quit+import build as I am also getting a red-colored file in the explorer pane even if there are no compile errors in sbt. Now I can't reproduce, unfortunately. But I still have red coloring of the file even if there is no compile errors in sbt but it seems to complain about the colon after object so maybe it start thinking that I'm on Scala 2 or something???

Image

@bjornregnell
Copy link
Contributor Author

Image

@bjornregnell
Copy link
Contributor Author

(I usually try now to delete all dot-files and target, but I'll wait a bit if you want me to check something else... @tgodzik )

@bjornregnell
Copy link
Contributor Author

AHA! When I added a space on the line with the error-marked colon and saved then the error went away (sic!) and looks like:

Image

@bjornregnell
Copy link
Contributor Author

F2 continue working so can't reproduce I'm afraid...

Image

@tgodzik
Copy link
Contributor

tgodzik commented Jan 28, 2025

We can try to add a new check just in case unless we already do it.

@tgodzik tgodzik added improvement Not a bug or a feature, but something general we can improve and removed needs more information Use if we need more information for a specific ticket labels Jan 28, 2025
@tgodzik tgodzik moved this from Triage to To do in Metals Issue Board Jan 28, 2025
@bjornregnell
Copy link
Contributor Author

Seems like an off-by-one bug somewhere... :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement Not a bug or a feature, but something general we can improve
Projects
Status: To do
Development

No branches or pull requests

2 participants