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

Make CodeGenerator abstract #7401

Open
1 task done
Tracked by #6828
BeksOmega opened this issue Aug 16, 2023 · 1 comment
Open
1 task done
Tracked by #6828

Make CodeGenerator abstract #7401

BeksOmega opened this issue Aug 16, 2023 · 1 comment
Labels
issue: feature request Describes a new feature and why it should be added

Comments

@BeksOmega
Copy link
Collaborator

Check for duplicates

  • I have searched for similar issues before opening a new one.

Problem

The CodeGenerator class doesn't work as is. You either need to subclass it to define methods like quote_ and scrub_, or you need to cludge onto an instance (which we should not be encouraging).

Request

As such we should make CodeGenerator abstract.

Alternatives considered

No response

Additional context

We want to hold off on doing this until we are ready to publish the correct types for generators. (Or at least until we finish refactoring the API of CodeGenerator).

@BeksOmega BeksOmega added the issue: feature request Describes a new feature and why it should be added label Aug 16, 2023
@gonfunko
Copy link
Contributor

gonfunko commented Dec 8, 2023

Note that https://blocklycodelabs.dev/codelabs/custom-generator/index.html?index=..%2F..index#2 uses the ability to directly instantiate a CodeGenerator (using the deprecated Generator alias) and should also be updated if this is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
issue: feature request Describes a new feature and why it should be added
Projects
None yet
Development

No branches or pull requests

2 participants