Nested enum types have no name
Dieses Issue hat noch niemand übernommen.
Bewertung
- Schwierigkeit
- 4/5
- Geschätzter Aufwand
- 3-5 Tage
- Anfängerfreundlichkeit
- 35/100
Rechercherichtung
Beginne mit der Untersuchung der JSON-Protokolldefinitionen und des Inline-Enums in emulateTouchFromMouseEvent und vergleiche es anschließend mit dispatchMouseEvent. Ermittle, ob wiederholte Enum-Strukturen einen einzigen benannten Typ oder unabhängige Typen darstellen; abgeschlossen ist die Aufgabe, wenn Inline-Enums benannte Domänendefinitionen haben und Properties oder Parameter Referenzen verwenden.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Beschreibung
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.
- Vorherrschende Sprache
- JavaScript
- Sterne
- 1.6k
- Forks
- 281
- Ø Merge
- 1 T. 19 Std.
- Gemergte PRs (30 T.)
- 1
Entwicklungsumgebung
Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.
Erste Schritte
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus ChromeDevTools/devtools-protocol
-
Schwierigkeit 4/5 3-5 Tage Anfängerfreundlichkeit 35/100
ChromeDevTools/devtools-protocol#311 · 1 Kommentar ·
-
Schwierigkeit 5/5 Über eine Woche Anfängerfreundlichkeit 30/100
ChromeDevTools/devtools-protocol#298 · 4 Reaktionen ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 35/100
ChromeDevTools/devtools-protocol#233 · 4 Kommentare ·
-
Keep track of URL changesEvtl. wieder frei @hashseed hat das vor 2202 Tagen übernommen, und es ist kein Pull Request offen. Offen
ChromeDevTools/devtools-protocol#224 · 4 Kommentare · 1 Reaktion · 1 zugewiesene Person ·
Alle Issues in ChromeDevTools/devtools-protocol
Ähnliche Issues
-
Add: Digi 4K LogoOffencheck:passed logos:add
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 82/100
Maintainer antworten meist innerhalb von 1 Tag
-
component/administration domain/framework needs-triage Platform(Default) priority/low
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 88/100
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 90/100
semantic-release/gitlab#1032 ·
-
agent/guide documentation hive/hosted-available-lke648397-260827-5n31
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 92/100
Maintainer antworten meist innerhalb von 1 Tag
-
[aw] Upgrade availableOffenagentic-workflows
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
githubnext/gh-aw-workshop#3933 ·
Maintainer antworten meist innerhalb von 2 Tagen