Resource cache
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
Research direction
Start by reviewing the resource-loading use case in sublime_lib.syntax and the Sublime Text find_resources API described in the issue. The proposal is still seeking feedback rather than naming an implementation location or tests; done would require an agreed cache design and a resulting pull request.
Written by the indexing model from the issue text.
Description
Sometimes, a plugin will want to load data from an open-ended number of resources. A motivating example is our own use of sublime-syntax and tmLanguage files in sublime_lib.syntax. Another example is the in-development SublimeTemplate package, which looks for and parses sublime-template files. A more nebulous example might be JS Custom, when I find a graceful way to handle user-provided syntax extensions.
Loading and processing all of these files could be a performance risk. The obvious solution is caching.
An eager approach using listeners might be a bit complicated. A lazier approach would be to check file modification times when a list is requested. This should probably work well enough, unless there are OS-specific issues I'm not aware of.
A cache would be initialized with:
- A pattern like
*.sublime-template, or maybe a list of patterns. - (optional) A filtering function operating on resource paths.
- A transformation, such as a parsing function.
The cache would keep a map from resource paths to:
- The actual OS file path (which might end at a
sublime-package). - That path's last modification time.
- The transformed data.
When the user requests a list of items, the cache would call sublime.find_resources, check the locations and modification times of those files, refresh any that have moved or been modified; then, return the list.
Thoughts? If the general idea seems reasonable, I'll write up a PR.
- Dominant language
- Python
- Stars
- 56
- Forks
- 4
- PR merge metrics
- No merged PRs in 30d
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from SublimeText/sublime_lib
-
documentation
Difficulty 3/5 1-2 days Newbie friendliness 35/100
SublimeText/sublime_lib#183 ·
-
documentation
Difficulty 2/5 1-3 hours Newbie friendliness 38/100
SublimeText/sublime_lib#173 · 1 reaction ·
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
SublimeText/sublime_lib#164 · 1 comment ·
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
SublimeText/sublime_lib#141 · 2 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 42/100
SublimeText/sublime_lib#139 · 4 comments ·
All issues in SublimeText/sublime_lib
Similar issues
-
triage/confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
agentscope-ai/agentscope#2775 ·
-
comp/desktop P3 type/bug
Difficulty 1/5 Under an hour Newbie friendliness 92/100
NousResearch/hermes-agent#118866 ·
-
bug
Difficulty 1/5 Under an hour Newbie friendliness 90/100
apache/cloudstack#14222 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100