gopls/internal/golang: suggest smart variable names during extract refactoring - #662
gopls/internal/golang: suggest smart variable names during extract refactoring#662rizl123 wants to merge 1 commit into
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
|
This PR (HEAD: de63649) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/806740. Important tips:
|
|
Message from Gopher Robot: Patch Set 1: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/806740. |
|
Message from Gopher Robot: Patch Set 1: Congratulations on opening your first change. Thank you for your contribution! Next steps: Most changes in the Go project go through a few rounds of revision. This can be Please don’t reply on this GitHub thread. Visit golang.org/cl/806740. |
|
Message from Ris: Patch Set 2: (1 comment) Please don’t reply on this GitHub thread. Visit golang.org/cl/806740. |
…factoring Improve the variable and constant naming logic in 'extract variable' code actions. Instead of defaulting to generic names like 'newVar', gopls now derives candidate variable names based on: - Stripping action prefixes from call expressions (e.g. 'parseConfig()' -> 'config') - Selector/field names for field expressions - Type names, unwrapped pointers, and pluralized slice/array containers - Special well-known types (e.g. 'error' -> 'err') - Converting acronyms/initialisms to lowerCamelCase (e.g. 'GetURL()' -> 'url')
de63649 to
85ada56
Compare
|
This PR (HEAD: 85ada56) has been imported to Gerrit for code review. Please visit Gerrit at https://go-review.googlesource.com/c/tools/+/806740. Important tips:
|
Improve the variable and constant naming logic in 'extract variable' code
actions. Instead of defaulting to generic names like 'newVar', gopls now
derives candidate variable names based on:
error->err)