Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

A "maintainer" or "owner" class for view.add_regions

未关闭
#141 2 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

评估

难度
5/5
预计耗时
一周以上
新手友好度
25/100
Issue 类型
功能
描述清晰度
基本清楚
活跃度
停滞
技术栈
python
领域
tooling

调研方向

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,通用步骤见我们的新手贡献指南。

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

SublimeText/sublime_lib 的其他 Issue

查看 SublimeText/sublime_lib 的全部 Issue

相似的 Issue

更多 Python Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。