A "maintainer" or "owner" class for view.add_regions
还没有人认领这个 Issue。
评估
调研方向
Start by reviewing Sublime Text's view.add_regions and view.erase_regions APIs and how resource cleanup is handled in the library. Clarify the maintainer's lifecycle and ownership semantics before deciding what implementation and tests would establish that regions are cleaned up when no longer needed.
由索引模型根据 Issue 内容生成。
描述
Decorated regions in a view can be regarded as a resource. Resources must be cleaned up when they are no longer needed.
It is too easy to forget this in a large plugin (or even a small plugin). For instance, one tends to forget to clean up regions when a plugin gets disabled.
It'd be nice to have a class that maintains this resource. Something like this (just an idea):
class AddRegionsMaintainer:
def __init__(self, view: sublime.View, key: str, *args: Any, **kwargs: Any) -> None:
self._view = view
self._key = key
self(*args, **kwargs)
def __call__(self, *args: Any, **kwargs: Any) -> None:
self._view.add_regions(self._key, *args, **kwargs)
def __del__(self) -> None:
self._view.erase_regions(self._key)
- 主要语言
- Python
- 星标
- 56
- 派生
- 5
- 平均合并
- 25 分钟
- 30 天内合并 PR
- 3
环境准备
这个项目没有提供开发容器、Dockerfile 或贡献指南,环境需要你自己搭建:先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
SublimeText/sublime_lib 的其他 Issue
-
documentation
难度 3/5 1-2 天 新手友好度 35/100
SublimeText/sublime_lib#183 ·
-
documentation
难度 2/5 1-3 小时 新手友好度 38/100
SublimeText/sublime_lib#173 · 1 个 reaction ·
-
难度 5/5 一周以上 新手友好度 35/100
SublimeText/sublime_lib#164 · 1 条评论 ·
-
Since 4075, settings are iterable可能已有人在做 @FichteFoll 于 247 天前认领。 未关闭
难度 3/5 1-2 天 新手友好度 42/100
SublimeText/sublime_lib#139 · 4 条评论 ·
-
Include type hints in documentation可能重新可做 @Thom1729 于 2346 天前认领,目前没有进行中的 PR。 未关闭documentation
SublimeText/sublime_lib#137 · 3 条评论 · 已指派 1 人 ·
查看 SublimeText/sublime_lib 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 68/100
nansencenter/geodataset#39 ·
-
bug
难度 2/5 1-3 小时 新手友好度 76/100
awslabs/visual-asset-management-system#804 ·
维护者通常 1 天内回复
-
follow-up
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 68/100
维护者通常 1 天内回复
-
link-rot
难度 1/5 1 小时以内 新手友好度 67/100