-
Notifications
You must be signed in to change notification settings - Fork 3.8k
Open
Labels
issue: feature requestDescribes a new feature and why it should be addedDescribes a new feature and why it should be added
Milestone
Description
Check for duplicates
- I have searched for similar issues before opening a new one.
Problem
There are a bunch of methods and properties within the generator code that:
- Are protected, when they need to be public so they can be used by block-code generators.
- Have confusing names.
The following things are protected but used by generators:
- quote_ (used by string block)
- multiline_quote_ (used by multiline string block)
- nameDB_ (also addressed in Address nameDB_ or add api to get name of a variable #6008)
- definitions_ (we just cludge imports and user-defined procedures onto this object, you need to know its naming semantics to do this correctly)
- scrub_ (needs to be called by procedure definition blocks to handle comments)
The provideFunction_ method (which is only supposed to be used for developer-defined functions) is public, but has a sad underscore in the name :/
Request
Provide an API that matches what external developers are actually trying to do.
I think it should look something like:
- getVariableName
- getProcedureName
- quote
- multilineQuote
- addProcedure -> This should handle scrubbing and finding a name
- addImport
- addDeveloperFunction
Alternatives considered
Make the protected methods public so they're actually usable. But stick with the less-than-ideal API.
Additional context
Related to #6008 (should possibly supercede it)
pavi2410 and varshneydevansh
Metadata
Metadata
Assignees
Labels
issue: feature requestDescribes a new feature and why it should be addedDescribes a new feature and why it should be added