-
-
Notifications
You must be signed in to change notification settings - Fork 30
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
Feature: AI code refactoring #82
Comments
You can use the default selection code for this one: function getSelectionText() {
var text = "";
if (window.getSelection) {
text = window.getSelection().toString();
} else if (document.selection && document.selection.type != "Control") {
text = document.selection.createRange().text;
}
return text;
} Source: https://stackoverflow.com/questions/5379120/get-the-highlighted-selected-text |
For the selected lines in the GitHub UI, you can use this: document.querySelectorAll('.code-review.selected-line ') |
Thanks for your inputs @a0m0rajab, I'll try this and make a PR where you can comment! |
Thank you for that, I would love to see the implementation of it though! |
I'll test things out and both of us will know only when I create the PR :p |
It would be great to see the PR :) |
Resolved by #90. |
Type of feature
🍕 Feature
Current behavior
With #79 winding down and getting ready for completion, thinking of the next AI feature ideas.
feel free to discuss other ideas in the discord
My pitch is to use the inline comment on the file changes to generate suggested changes
Suggested solution
A user can use suggested changes to generate new code using the [suggested changes feature]
The example below is me pointing at the "suggested changes" button. I am suggesting an enum instead of a case statement and using the AI to generate the enum.
(https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/incorporating-feedback-in-your-pull-request) and OpenSauced.ai
Additional context
No response
Code of Conduct
Contributing Docs
The text was updated successfully, but these errors were encountered: