5

fix: Extract Function produces duplicate fn names by DorianListens · Pull Reques...

 2 years ago
source link: https://github.com/rust-lang/rust-analyzer/pull/12662
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Contributor

@DorianListens DorianListens commented 7 days ago

edited

This change fixes #10037, in more or less the most naive fashion
possible.

We continue to start with the hardcoded default of "fun_name", and now append a
counter to the end of it if that name is already in scope.

In the future, we can probably apply more heuristics here to wind up with more
useful names by default, but for now this resolves the immediate problem.

All reactions

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK