-
Notifications
You must be signed in to change notification settings - Fork 326
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
Automatically backtick symbols when renaming #2605
Conversation
metals/src/main/scala/scala/meta/internal/rename/RenameProvider.scala
Outdated
Show resolved
Hide resolved
642f2d2
to
70c8f9c
Compare
@@ -288,7 +288,7 @@ class RenameLspSuite extends BaseRenameLspSuite("rename") { | |||
| "" <<::>> user | |||
|} | |||
|""".stripMargin, | |||
newName = "method:" | |||
newName = "+++:" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That was actually a wrongly named method - method:
should be wrapped in backticks, which it started doing.
c069b84
to
a717a39
Compare
@@ -241,7 +231,7 @@ final class RenameProvider( | |||
realName = rng.inString(semanticDb.text) | |||
if occ.symbol == occurence.symbol && | |||
withoutBacktick(realName) == withoutBacktick(renameName) | |||
} yield realLocationWithoutBackticks(realName, rng.toLSP) | |||
} yield new Location(uri, rng.toLSP) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If new name is checked to have backticks then this is not needed.
In cases where a symbol name is not valid we should automatically wrap it in backticks
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
In cases where a symbol name is not valid we should automatically wrap it in backticks