Conversation
|
I would change the condition so that the type union is not produced for The only places where this seems to be in the metaModel currently is for ErrorCodes and LSPErrorCodes. But neither of them are referenced in any other LSP type, so technically no lint error would occur at the moment. That is because ResponseError doesn't seem to be part of the metaModel (and doesn't directly reference the ErrorCodes in the specs, so we have the But if there would be another IntEnum type with custom values in the future, the type union might also be needed for proper lint checks. So something like this (untested): if (
(enum := context['enumerations'].get(literal_symbol_name))
and enum.get('supportsCustomValues')
and ENUM_OVERRIDES.get(literal_symbol_name) != 'IntFlag' # only for string enums and int enums, bitwise combinations of IntFlag are handled fine
): |
|
We didn't have ENUM_OVERRIDES in this context so did a refactor to pass it. EDIT: Well, we could have imported it but it's not how the code wanted to do things. |
Address #39 (comment)
Also remove
IntFlagoverride forApplyKindsince it's not a bitwise flag. (see #39 (comment))