Skip to content

Commit 0c64d85

Browse files
committed
Fixes for newer pygments types.
1 parent 993482c commit 0c64d85

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

jsonschema_lexer/_lexer.py

+10-4
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,22 @@
22
Contains the main functionality of the JSONSchemaLexer.
33
"""
44

5+
from __future__ import annotations
6+
57
from importlib.resources import files
68
from pathlib import Path
7-
from typing import Any, ClassVar
9+
from typing import TYPE_CHECKING
810
import json
911

1012
from pygments.lexers.data import ( # type: ignore[reportMissingTypeStubs]
1113
JsonLexer,
1214
)
1315
from pygments.token import Token
1416

17+
if TYPE_CHECKING:
18+
from collections.abc import Sequence
19+
from typing import Any, ClassVar
20+
1521

1622
class JSONSchemaLexer(JsonLexer):
1723
"""
@@ -20,13 +26,13 @@ class JSONSchemaLexer(JsonLexer):
2026

2127
name = "JSON Schema"
2228
url = "https://json-schema.org"
23-
aliases: ClassVar[list[str]] = ["jsonschema", "json-schema"]
24-
mimetypes: ClassVar[list[str]] = [
29+
aliases: Sequence[str] = ["jsonschema", "json-schema"]
30+
mimetypes: Sequence[str] = [
2531
"application/schema+json",
2632
"application/schema-instance+json",
2733
]
2834

29-
data_types: ClassVar[list[str]] = [
35+
data_types: ClassVar[Sequence[str]] = [
3036
'"object"',
3137
'"integer"',
3238
'"string"',

0 commit comments

Comments
 (0)