From 26d9289e7e8ae6b408fa3d22f76bb20cad13b6ad Mon Sep 17 00:00:00 2001 From: github-actions Date: Wed, 9 Mar 2022 10:38:27 +0000 Subject: [PATCH] [docgen] Update doc/neogen.txt skip-checks: true --- doc/neogen.txt | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/doc/neogen.txt b/doc/neogen.txt index 94fe3f5..9c5c580 100644 --- a/doc/neogen.txt +++ b/doc/neogen.txt @@ -8,7 +8,7 @@ Table of contents: Generate annotations.....................................|neogen.generate()| Contributing................................................|neogen-develop| Changes in neogen plugin..................................|neogen-changelog| - Use popular snippet engines............................|snippet-integration| + Use popular snippet engines.....................|neogen-snippet-integration| Configurations for the template table........|neogen-template-configuration| How to create/customize an annotation....................|neogen-annotation| @@ -114,7 +114,7 @@ Neogen provides those defaults, and you can change them to suit your needs < Default configurations for a languages can be found in `lua/neogen/configurations/.lua` - - To know which snippet engines are supported, take a look at |snippet-integration|. + - To know which snippet engines are supported, take a look at |neogen-snippet-integration|. Example: `snippet_engine = "luasnip"` @@ -171,7 +171,7 @@ Note: We will only document `major` and `minor` versions, not `patch` ones. - Improve godoc template (#75) ## 2.3.0~ - Added bundled support with snippet engines ! - Check out |snippet-integration| for basic setup + Check out |neogen-snippet-integration| for basic setup ## 2.2.0~ ### Python~ - Add support for `*args` and `**kwargs` @@ -189,7 +189,7 @@ Note: We will only document `major` and `minor` versions, not `patch` ones. ============================================================================== ------------------------------------------------------------------------------ - *snippet-integration* + *neogen-snippet-integration* `snippet` To use a snippet engine, pass the option into neogen setup: @@ -202,6 +202,17 @@ To use a snippet engine, pass the option into neogen setup: Some snippet engines come out of the box bundled with neogen: - `"luasnip"` (https://github.com/L3MON4D3/LuaSnip) +# Add support for snippet engines~ + +To add support to a snippet engine, go to `lua/neogen/snippet.lua`. +There's a table called `snippet.engines` that holds functions that will be called +depending of the snippet engine + +Those functions have this signature: +`snippet_engine_name = function (snip, pos)` where +- `snip` is a lsp styled snippet (in table format) +- `pos` is a { row , col } table for placing the snippet + ============================================================================== ------------------------------------------------------------------------------