Remove subclassing from actions.ts
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 15.2k
- Forks
- 1.5k
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 6
Description
We have this pattern going on in actions.ts where, if we want to implement an action that's similar to another action, we make a new class that just extends the old class and reimplements what changed.
I am not a big fan of this. The main problem is that if someone changes the base class, it's not obvious at all that the subclasses could have been depending on the behavior of the base class.
I would like to refactor actions.ts so that no concrete actions extend from other concrete actions. This can be done in two steps.
- For all actions that are synonyms (ctrl-[ and esc, for example), we need to make the
keysvariable accept a list of key sequences rather than just one. - For all actions that are not synonyms but actually have differing implementations (not sure how many of these we even have), I am ok with extending from a shared "abstract" base class.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading actions.ts and inventory concrete actions that extend other concrete actions, including the remaining non-synonym cases. Check how the shared abstract behavior and key-sequence handling are represented. Done means no concrete action extends another concrete action, while differing implementations use an appropriate shared abstract base.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Refactor
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100