From decbf378e88d3d140b5e3bf26465dea2f971f7d8 Mon Sep 17 00:00:00 2001 From: Colin Kennedy Date: Mon, 2 Sep 2024 15:53:43 -0700 Subject: [PATCH] Added snippet_engine parameter Added missing version information --- doc/neogen.txt | 6 ++++-- lua/neogen/generator.lua | 4 ++-- lua/neogen/init.lua | 4 +++- 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/doc/neogen.txt b/doc/neogen.txt index 654f613a..d2add55f 100644 --- a/doc/neogen.txt +++ b/doc/neogen.txt @@ -182,12 +182,14 @@ Feel free to submit a PR, I will be happy to help you ! We use semantic versioning ! (https://semver.org) Here is the current Neogen version: >lua - neogen.version = "2.19.4" + neogen.version = "2.20.0" < # Changelog~ Note: We will only document `major` and `minor` versions, not `patch` ones. (only X and Y in X.Y.z) +## 2.20.0~ + - Add the `snippet_engine` parameter to `neogen.generator` (#202) ## 2.19.0~ - Add support for julia (`julia`) ! (#185) ## 2.18.0~ @@ -464,4 +466,4 @@ If not specified, will use this line for all types. {required} `(string)` If specified, is used in if the first field of the table is a `table` (example above) - vim:tw=78:ts=8:noet:ft=help:norl: \ No newline at end of file + vim:tw=78:ts=8:noet:ft=help:norl: diff --git a/lua/neogen/generator.lua b/lua/neogen/generator.lua index 67918f63..40b28e97 100644 --- a/lua/neogen/generator.lua +++ b/lua/neogen/generator.lua @@ -235,7 +235,7 @@ local function generate_content(parent, data, template, required_type, annotatio end return setmetatable({}, { - __call = function(_, filetype, node_type, return_snippet, annotation_convention) + __call = function(_, filetype, node_type, return_snippet, annotation_convention, snippet_engine) if filetype == "" then notify("No filetype detected", vim.log.levels.WARN) return @@ -319,7 +319,7 @@ return setmetatable({}, { return generated_snippet, row end - local snippet_engine = conf.snippet_engine + snippet_engine = snippet_engine or conf.snippet_engine if snippet_engine then -- User want to use a snippet engine instead of native handling local engines = snippet.engines diff --git a/lua/neogen/init.lua b/lua/neogen/init.lua index 160d6c7b..d2cf3d8c 100644 --- a/lua/neogen/init.lua +++ b/lua/neogen/init.lua @@ -241,6 +241,8 @@ end --- --- Note: We will only document `major` and `minor` versions, not `patch` ones. (only X and Y in X.Y.z) --- +--- ## 2.20.0~ +--- - Add the `snippet_engine` parameter to `neogen.generator` (#202) --- ## 2.19.0~ --- - Add support for julia (`julia`) ! (#185) --- ## 2.18.0~ @@ -309,7 +311,7 @@ end --- with multiple annotation conventions. ---@tag neogen-changelog ---@toc_entry Changes in neogen plugin -neogen.version = "2.19.4" +neogen.version = "2.20.0" --minidoc_afterlines_end return neogen