Skip to content

feat: code actions - document edits - #478

Merged
archseer merged 18 commits into
helix-editor:masterfrom
gbaranski:code-action
Jul 24, 2021
Merged

feat: code actions - document edits#478
archseer merged 18 commits into
helix-editor:masterfrom
gbaranski:code-action

Conversation

@gbaranski

@gbaranski gbaranski commented Jul 21, 2021

Copy link
Copy Markdown
Contributor

No description provided.

@gbaranski gbaranski mentioned this pull request Jul 21, 2021
Comment thread helix-term/src/commands.rs Outdated
Co-authored-by: Ivan Tham <pickfire@riseup.net>
Comment thread helix-term/src/commands.rs Outdated
Comment thread helix-term/src/commands.rs Outdated
@gbaranski

Copy link
Copy Markdown
Contributor Author

There are still some features that are not implemented yet, just because I couldn't find any code that uses them, so I can't really test if it works.

That's how it currently looks like

code-actions-helix.mp4

@gbaranski
gbaranski marked this pull request as ready for review July 22, 2021 10:08
@kirawi

kirawi commented Jul 23, 2021

Copy link
Copy Markdown
Member

The clippy errors need to be addressed,

Comment thread helix-term/src/commands.rs Outdated
@kirawi

kirawi commented Jul 23, 2021

Copy link
Copy Markdown
Member

Looks great otherwise, though I'm not really familiar with this section of the codebase. Good job!

@gbaranski gbaranski changed the title feat: code actions feat: code actions - document edits Jul 23, 2021
@gbaranski gbaranski mentioned this pull request Jul 23, 2021
4 tasks
Comment thread helix-term/src/commands.rs
@gbaranski
gbaranski requested a review from archseer July 23, 2021 12:27
@archseer

Copy link
Copy Markdown
Member

Switch out todo! for editor.set_error so we don't panic anymore and I think this is good to merge!

@gbaranski

Copy link
Copy Markdown
Contributor Author

Switch out todo! for editor.set_error so we don't panic anymore and I think this is good to merge!

Done, I've forgot to commit & push the changes I made few hours ago.

@archseer
archseer merged commit 48e344a into helix-editor:master Jul 24, 2021
@archseer

Copy link
Copy Markdown
Member

Great work!

})
.collect();
let transaction = edits_to_transaction(doc.text(), &edits);
doc.apply(&transaction, view.id);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Undo doesn't work after applying a change:

Suggested change
doc.apply(&transaction, view.id);
doc.apply(&transaction, view.id);
doc.append_changes_to_history(view.id);

@gbaranski gbaranski Jul 24, 2021

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It did work after pressing ESC, but with this change works even without it. I can't commit changes since the PR have been already merged. Maybe you could create a new PR with this change?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, ESC is bound to normal_mode command (even inside normal mode) and it has an append_changes_to_history call. I see you created a new PR 👍🏾

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants