Skip to content
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

feat: refactoring action to extract an eel statement #324

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

PRGfx
Copy link
Contributor

@PRGfx PRGfx commented Sep 14, 2024

Introduces a new assignment for a selected part of an EEL assignment:
The selected expressions from an assignment are added to a new assignment in the preceding line and replaced with a reference to the new key. The new key can than be renamed.

ToDo/Nice-to-have:

  • Implement tests
  • Fix extraction for partial expressions (For most cases it should work, but there probably are some more edge-cases where a selection doesn't look like it can't be extracted - and maybe rightfully so...)
  • Implement selection of scope (this, props, private) (I was thinking about a selection like var/const/let selection for JS, but this doesn't work well for me and I haven't looked into that yet.)
  • Implement clean renaming of introduced variable (Currently I just place carets and selection over the new variable to allow typing over it. Full renaming logic for fusion is a bit more involved I'm afraid.)
  • (Warn if new name is already in use)

The code for extracting the EEL expressions feels super scuffed, but I didn't have a nice idea for now.

Extracts selected parts of an eel statement into a new assignment.
@PRGfx PRGfx mentioned this pull request Sep 22, 2024
11 tasks
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.

1 participant