Nested enum types have no name
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 35/100
Research direction
Start by inspecting the JSON protocol definitions and the inline enum in emulateTouchFromMouseEvent, then compare it with dispatchMouseEvent. Determine whether repeated enum shapes represent one named type or independent types; done when inline enums have named domain definitions and properties or parameters use references.
Written by the indexing model from the issue text.
Description
Some domain types/commands/events in the JSON protocol definitions have properties/parameters of enum types that are not references to a top-level domain enum type, but that are instead inlined on the spot. For instance here is one:
...
{
"name": "emulateTouchFromMouseEvent",
"description": "Emulates touch event from the mouse event parameters.",
"experimental": true,
"parameters": [
{
"name": "type",
"description": "Type of the mouse event.",
"type": "string",
"enum": [
"mousePressed",
"mouseReleased",
"mouseMoved",
"mouseWheel"
]
...
I'm generating code from the JSON definitions, but I'm facing 2 problems with this at the moment:
- because these types are not defined at the top level as "domain types", they have no name so I have to either use a plain
Stringtype (which defeats the purpose of the enum) or generate a name (which might not be user-friendly). In the example above, a good name might beMouseEventType. This problem would affect any language that doesn't support string union types (in my case, Kotlin). - some of these enums are implicitily reused across multiple commands/events (the example above appears in
dispatchMouseEventandemulateTouchFromMouseEvent), but there is no way to tell whether they are different types and just happen to have the same enum values (and thus might change independently), or whether they are a single reused type (and thus will evolve together and always stay in sync). This means I cannot choose systematically between declaring different enum types or just one. This problem would affect the same set of languages I believe, basically all those who have to declare enums as a named type.
I haven't found any inlined object type like this (these are only refs), I only found enums suffering from this problem.
It would be great if all enums were extracted into the domain types list and only references appeared in the properties and parameters. Some enums already are defined at the top level, just not all of them.
- Dominant language
- JavaScript
- Stars
- 1.6k
- Forks
- 291
- PR merge metrics
- No merged PRs in 30d
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
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.
More from ChromeDevTools/devtools-protocol
-
Difficulty 4/5 1-2 days Newbie friendliness 3/100
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
ChromeDevTools/devtools-protocol#311 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
ChromeDevTools/devtools-protocol#298 · 4 reactions ·
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
ChromeDevTools/devtools-protocol#233 · 4 comments ·
-
Keep track of URL changesMay be free again @hashseed claimed this 2266 days ago, and no pull request is open. Open
ChromeDevTools/devtools-protocol#224 · 4 comments · 1 reaction · 1 assignee ·
All issues in ChromeDevTools/devtools-protocol
Similar issues
-
[Feature]: Add Crawl Optimization setting to disable WordPress random content redirect (WP 7.2)Openenhancement featurerequest
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Yoast/wordpress-seo#23888 ·
Maintainers usually reply within 4 days
-
bug builder-vite hmr sev:S3
Difficulty 2/5 1-3 hours Newbie friendliness 79/100
storybookjs/storybook#37965 · 2 comments · 1 reaction ·
Maintainers usually reply within 1 day
-
area/docs good first issue
Difficulty 2/5 1-3 hours Newbie friendliness 66/100
aws-samples/sample-collaborative-ai-dlc#996 ·
Maintainers usually reply within 1 day
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
sagemathinc/sagebrush#3434 ·
Maintainers usually reply within 1 day
-
New tool: BioFigurePossibly taken @github-actions claimed this today. Opensubmission triage
Difficulty 1/5 Under an hour Newbie friendliness 70/100
kausalflow/tools#386 · 1 comment ·
Maintainers usually reply within 1 day