-
-
Notifications
You must be signed in to change notification settings - Fork 260
WIP: Add MANY type annotations π #1396
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
Draft
bew
wants to merge
23
commits into
L3MON4D3:master
Choose a base branch
from
bew:add-MANY-types
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
01634c7
Add MANY type annotations π
bew 12eaf52
Event moar types & docstrings! π
bew e00160c
Add few more types & docs
bew 41a1113
Auto generate docs
bew 1a1f929
Format with stylua
bew 22c82a8
Fix SnippetString type errors
bew 344ecda
Apply easy suggestions (part1)
bew f1b6dea
Format with stylua
bew 02cabf1
Apply easy suggestions (part2)
bew ec94a55
Auto generate docs
bew 281fdee
Format with stylua
bew 6204bbd
Apply easy suggestions (part3)
bew 1c42996
Format with stylua
bew 1641838
Fill InsertNode doc, fix few other docs
bew 68b7376
Rewrite condition objects: fully typed & readable/explicit combinations
bew 85b9618
Apply easy suggestions (part4)
bew 1606b23
Auto generate docs
bew ce7f8a0
Format with stylua
bew d2b494a
Move/adapt docs from DOC.md for condition object
bew 84d7d32
Format with stylua
bew 05be5e2
Misc with few types, doc & FIXMEs..
bew 6d0b593
Add more docs around marks & positions, fix node_callbacks type
bew 8a61d9b
Auto generate docs
bew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't quite get at what point a snippet is a
BareInternalSnippet.. In my mind there isAddablefor things that can be put intoadd_snippets,Expandablefor stuff that has:matchesandconditionand the like, and then there isExpandedSnippetfor when the snippet is expanded.As far as I remember
snippet,dependents_dict,child_snippets,static_text, andindentstrare only used by snippets once they are expanded, maybeExpandedSnippetis a better place for them? (And maybe it'd be a good idea to initialize them intrigger_expand?)Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had to make something for the return type of
_S, which is used in different places for defining different types.And it's made to have the common fields for all other classes that are derived from it.
It's used as the common base for
Snippet&SnippetNode:---@class LuaSnip.SnippetNode: LuaSnip.BareInternalSnippet, LuaSnip.NormalizedSnippetNodeOpts---@class LuaSnip.Snippet: LuaSnip.BareInternalSnippet, LuaSnip.NormalizedSnippetContext, LuaSnip.NormalizedSnippetOpts, LuaSnip.AddableThose two don't share all the same fields nor the same parent classes, so we need a kind of base class for all their common fields π€
Interesting, I'll have to explore that!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ahh I see.. this seems fine π
So far I'd thought of snippet as a specialization of snippetNode, but it's possible that, rigourously, there are some conflicts there π