microsoft / vscode-copilot-release

Feedback on GitHub Copilot Chat UX in Visual Studio Code.
https://marketplace.visualstudio.com/items?itemName=GitHub.copilot-chat
Creative Commons Attribution 4.0 International
296 stars 27 forks source link

Copilot rename suggestions ignore naming conventions from context #1269

Open Ste1io opened 1 month ago

Ste1io commented 1 month ago

Copilot gives preferential treatment to camelCase naming convention when generating rename suggestions, regardless of the existing convention being used, naming convention of neighboring contextually-relevant functions, or even default language-specific best practices. For example, in a Python file:

1717098027-vitalog webapp_-_pages80_Analyze_Log_File py

1717098493-vitalog webapp_-_streamlit_state py

It's almost like the rename suggestion prompt assumes everything is JavaScript.

If the current name being sent with the rename suggestion prompt uses snake_case, the rename suggestions should adhere to that. If the naming convention is unclear from the function being renamed (ie def clear(self, key)), either use the surrounding context, or just default to the language's best practice based on the file's selected language type or filename extension.

Compare the results from my basic (naïve) prompt below, which doesn't even mention naming conventions or include other existing function names in the context, to the inline function rename suggestions:

1717099317-vitalog webapp_-_pages80_Analyze_Log_File py

ulugbekna commented 1 month ago

Thank you for trying out the feature and filing this issue! I'll be working on a fix!