-
-
Notifications
You must be signed in to change notification settings - Fork 238
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use libuv-file-watcher to update loaded snippet-collections. #1033
Commits on Dec 2, 2023
-
duplicate: always return the same table for retrieve_all.
This is necessary for the key-invalidation in add_snippets, which expects that retrieve_all always returns the same objects.
Configuration menu - View commit details
-
Copy full SHA for 14b20a5 - Browse repository at this point
Copy the full SHA 14b20a5View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6b8cacf - Browse repository at this point
Copy the full SHA 6b8cacfView commit details -
Configuration menu - View commit details
-
Copy full SHA for 39c0b5b - Browse repository at this point
Copy the full SHA 39c0b5bView commit details -
calling add_edge twice with the same vertices will not connect the vertices twice.
Configuration menu - View commit details
-
Copy full SHA for 694baa9 - Browse repository at this point
Copy the full SHA 694baa9View commit details -
move lower-level methods out of main-module, add convenient wrappers.
Since these functions are called by eg. all the loaders, this removes some potential for cyclic dependencies. Also add enqueable-operations-wrapper around refresh_notify and clean_invalidated, to prevent sending multiple updates for the same filetype in the same "tick"(?), and to remove some overhead that would result from calling clean_invalidated in quick succession (user doesn't care if snippets are removed a few milliseconds later, ofc).
Configuration menu - View commit details
-
Copy full SHA for 1459438 - Browse repository at this point
Copy the full SHA 1459438View commit details -
fix: don't remove snippet-source set by loaders after first add.
If the same snippet-object is added to multiple filetypes, only the first filetype receives the source-information. This is actually done by the vscode-package-loader, so not a theoretical concern, I guess jump-to-snippet is just not used enough for this to get noticed.
Configuration menu - View commit details
-
Copy full SHA for 3f58738 - Browse repository at this point
Copy the full SHA 3f58738View commit details -
feat: major overhaul of loaders. Check DOC.md-changes for the gist.
Previously, we could not * add files that were not present when `load/lazy_load` was called to the collection. This is pretty annoying if one wants to add project-local snippets, or snippets for a new filetype (ofc). * load collections whose directory/package.json(c) did not exist when `load` was called. This is also an annoyance when creating project-local snippets, since a re-`load()` is required for the snippets to be picked up. * pick up on changes to the snippet-files from another neovim-instance (due to reloading on BufWritePost) This patch fixes all of these by modularizing the loaders a bit more, into one component ("Collection") which takes care of all the logic of loading different files, and another ("fswatchers") which notify the collections when a file-change is detected. This allows, first of all, a better design where the first concern can be nullified, and secondly, us to use libuvs api for file-watching, to implement the last two (if a potentially non-existing collection should be loaded, we can use libuv to wait for the collection-root/manifest-file, and create the collection once that exists). Another cool addition is the loader-snippet-cache, which makes it so that the snippet files (for vscode and snipmate) are only loaded once for all filetypes, and not once for each filetype. That's probably not noticeable though, except if a collection with many extends/languages for one json-file is loaded :D
Configuration menu - View commit details
-
Copy full SHA for 3a47a1f - Browse repository at this point
Copy the full SHA 3a47a1fView commit details -
Configuration menu - View commit details
-
Copy full SHA for e13d6dd - Browse repository at this point
Copy the full SHA e13d6ddView commit details -
Configuration menu - View commit details
-
Copy full SHA for e4ad5fe - Browse repository at this point
Copy the full SHA e4ad5feView commit details