Repository navigation
AI-powered alternative name suggestions for variables and other symbols #65790
iadyo
started this conversation in
Feature Requests
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
What are you proposing?
I'd like to have an AI-powered option to suggest alternative names for variables, structs, functions, and other symbols directly in the editor. The idea is to select a symbol, trigger an action, and get a few naming suggestions based on the surrounding code, without having to open the AI chat or write a prompt.
Why does this matter?
Coming up with good names can be surprisingly difficult, even when you already know exactly what a variable or function does. Sometimes the current name is too generic, and I'd like to see a few alternatives without interrupting my workflow. This would make naming easier and help keep code more readable and consistent.
Are there any examples or context?
For example, given this Rust code:
AI could suggest names such as
orders,user_orders, orfetched_orders, depending on the surrounding code and how the variable is used. I'd like something similar to an inline suggestion popup, where I can quickly browse the alternatives and pick one.Possible approach
Add an action such as
AI: Suggest Namesto the editor's context menu, ideally with a keyboard shortcut. The AI could use the selected symbol, its type, and the surrounding code to generate a small list of relevant alternatives. Selecting a suggestion would rename the symbol using the existing LSP rename functionality where available. This could be an on-demand feature, so it wouldn't require additional AI requests while typing.All reactions