Skip to content

Commit aa90492

Browse files
committed
Use sublime-text-stubs for type checks
Gets rid of our custom _compat module that provided shallow stubs for the functionality we used.
1 parent 03ead2a commit aa90492

11 files changed

Lines changed: 28 additions & 66 deletions

File tree

‎plugin/_compat.py‎

Lines changed: 0 additions & 58 deletions
This file was deleted.

‎plugin/commands.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from ._compat import sublime_plugin
3+
import sublime_plugin
4+
45
from .ctrl_release import is_available
56
from .history import current_group_selection_state, sync_selection_history
67
from .mru import collect_entries

‎plugin/constants.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from ._compat import sublime
1+
import sublime
22

33
TAB_HISTORY_LIMIT = 20
44

‎plugin/ctrl_release/linux.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,8 @@
88
from dataclasses import dataclass
99
from typing import Any, Optional
1010

11-
from .._compat import sublime
11+
import sublime
12+
1213
from ._availability import set_unavailable
1314

1415
_XK_Control_L = 0xFFE3

‎plugin/ctrl_release/macos.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from collections.abc import Callable
77
from typing import Any, Optional
88

9-
from .._compat import sublime
9+
import sublime
10+
1011
from ._availability import set_unavailable
1112

1213
_CG_EVENT_SOURCE_STATE_COMBINED_SESSION_STATE = 0

‎plugin/ctrl_release/windows.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
from collections.abc import Callable
66
from typing import Any, Optional
77

8-
from .._compat import sublime
8+
import sublime
9+
910
from ._availability import set_unavailable
1011

1112
_VK_CONTROL = 0x11

‎plugin/history.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
from typing import Any, Optional, cast
44

5-
from ._compat import sublime
5+
import sublime
6+
67
from .constants import TAB_HISTORY_LIMIT
78
from .sheets import SheetIdentity, find_sheet_by_identity_and_group, sheet_identity
89
from .state import (

‎plugin/listener.py‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
from __future__ import annotations
22

3-
from ._compat import sublime, sublime_plugin
3+
import sublime
4+
import sublime_plugin
5+
46
from .ctrl_release import is_available
57
from .history import (
68
SelectionHistoryPoller,

‎plugin/session.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from __future__ import annotations
22

3-
from ._compat import sublime
3+
import sublime
4+
45
from .constants import KIND_MODIFIED
56
from .ctrl_release import CtrlReleasePoller
67
from .sheets import apply_group_selection

‎pyproject.toml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ requires-python = ">=3.8"
88
dev = [
99
"ruff",
1010
"ty",
11+
"sublime-text-stubs==1.4200.0b1",
1112
]
1213

1314
[tool.ruff]

0 commit comments

Comments
 (0)