-
-
Notifications
You must be signed in to change notification settings - Fork 257
doc: improve section on fmt. #551
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
Conversation
6ab1067
to
4fb2af7
Compare
Maybe add a Notes section and there explain it and link it in the entries referring to it? So you don't have to put the same in several places? |
Do you mean for explaining |
It is not, just if you will document the behaviour in other places you could just link it. |
Makes sense 👍
|
Though that is a pretty big number of links.. But you're right, it will come in handy. |
de00ef2
to
5266dd6
Compare
I've opted for working the sections that explain those concepts into the text, feels more natural than a big glossary at the end IMO, but happy to hear reasons for doing it differently :D |
That sounds awesome! |
4f844a9
to
fe19556
Compare
55b5e59
to
4585e98
Compare
9d61c8b
to
0f25785
Compare
Okay I think this is done, I'll hold off from merging until #612 is in, don't wanna complicate that. I've though about turning list-entries in |
b9cdc1d
to
ebd3060
Compare
Previously, jump-index, position, jump-position were used interchangibly. Explain concept of node-references ([number/absolute_indexer/node] passed to function/dynamicNodes). Also, give more detailed reference for especially the node-constructors.
72d1ff8
to
67372c6
Compare
Oookay, gonna have one last look tomorrow when I don't have past-midnight-brain, then merge |
parent (`parent.snippet`), which is passed to the function. | ||
SNIPPET-DATA ~ | ||
|
||
Snippets contain some interesting tables during runtime: - `snippet.env`: |
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.
don't you want to make a list here? having all items of the list on the same line isn't specially readable :/
< | ||
|
||
|
||
`t(text, node_opts)`: - `text`: `string` or `string[]` - `node_opts`: `table`, |
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.
same here
|
||
|
||
Examples: Use captures from the regex-trigger using a functionNode: | ||
`f(fn, argnode_references, node_opts)`: - `fn`: `function(argnode_text, parent, |
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.
here as well
|
||
Node-references are used to refer to other nodes in various parts of | ||
luasnip’s API. For example, argnodes in functionNode, dynamicNode or lambda | ||
are node-references. These references can be either of: - `number`: the |
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.
here also? for these references can be either of ....
that to construct `choiceNode`s: | ||
`lua local function restore_cursor_choice(pos, choices, opts) if opts then opts.restore_cursor = true else opts = {restore_cursor = true} end return c(pos, choices, opts) end` | ||
|
||
`c(jump_index, choices, node_opts)` - |luasnip-`jump_index`|: `number`, since |
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.
here (I think searching for a dash surrounded by spaces can find you all inlined lists)
`match` can insert text based on a predicate (again, a shorthand for | ||
`functionNode`). | ||
|
||
`match(argnodes, condition, then, else)`, where * `argnode`: A single |
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.
another list, using *
instead of -
Mhmm, looks like the helptext-generator is messing those up. |
pushed a fix, 4b8d678 |
Thank you for bringing them to my attention, I very rarely check the help-files 😅 |
Much better 👍 |
No description provided.