Skip to content
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

Added snippet_engine parameter #202

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions doc/neogen.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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~
Expand Down Expand Up @@ -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:
vim:tw=78:ts=8:noet:ft=help:norl:
4 changes: 2 additions & 2 deletions lua/neogen/generator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
4 changes: 3 additions & 1 deletion lua/neogen/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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~
Expand Down Expand Up @@ -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
Loading