File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 2121
2222
2323ENUM_OVERRIDES : dict [str , Literal ['StrEnum' , 'IntFlag' ]] = {
24- 'CodeActionKind' : 'StrEnum' ,
25- 'DocumentDiagnosticReportKind' : 'StrEnum' ,
26- 'FailureHandlingKind' : 'StrEnum' ,
27- 'FileOperationPatternKind' : 'StrEnum' ,
28- 'FoldingRangeKind' : 'StrEnum' ,
29- 'LanguageKind' : 'StrEnum' ,
30- 'MarkupKind' : 'StrEnum' ,
31- 'MonikerKind' : 'StrEnum' ,
32- 'PositionEncodingKind' : 'StrEnum' ,
33- 'ResourceOperationKind' : 'StrEnum' ,
34- 'SemanticTokenModifiers' : 'StrEnum' ,
35- 'SemanticTokenTypes' : 'StrEnum' ,
36- 'TokenFormat' : 'StrEnum' ,
37- 'TraceValue' : 'StrEnum' ,
38- 'UniquenessLevel' : 'StrEnum' ,
3924 'WatchKind' : 'IntFlag' ,
4025 'ApplyKind' : 'IntFlag' ,
4126}
Original file line number Diff line number Diff line change @@ -44,7 +44,7 @@ def to_string(enumeration: Enumeration) -> str:
4444 documentation = format_comment (enumeration .get ('documentation' ), indentation )
4545 kind = EnumKind .String if enumeration ['type' ]['name' ] == 'string' else EnumKind .Number
4646 enum_class_override = overrides .get (symbol_name )
47- enum_class = enum_class_override or ('Enum ' if kind == EnumKind .String else 'IntEnum' )
47+ enum_class = enum_class_override or ('StrEnum ' if kind == EnumKind .String else 'IntEnum' )
4848 values = format_enumeration_values (enumeration ['values' ], kind )
4949 result += f'class { symbol_name } ({ enum_class } ):\n '
5050 if documentation :
You can’t perform that action at this time.
0 commit comments