feat(rust) Add support for rust (func, file) #34
This commit is contained in:
@@ -194,6 +194,8 @@ There is a list of supported languages and fields, with their annotation style
|
|||||||
| | [Godoc](https://go.dev/blog/godoc) (`"godoc"`) | |
|
| | [Godoc](https://go.dev/blog/godoc) (`"godoc"`) | |
|
||||||
| java | | | `func`, `class` |
|
| java | | | `func`, `class` |
|
||||||
| | [Javadoc](https://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#documentationcomments) (`"javadoc"`) | |
|
| | [Javadoc](https://docs.oracle.com/javase/1.5.0/docs/tooldocs/windows/javadoc.html#documentationcomments) (`"javadoc"`) | |
|
||||||
|
| rust | | | `func`, `file` |
|
||||||
|
| | [Rustdoc](https://doc.rust-lang.org/rustdoc/what-is-rustdoc.html) (`"rustdoc"`) | |
|
||||||
|
|
||||||
|
|
||||||
## Adding Languages
|
## Adding Languages
|
||||||
|
|||||||
@@ -122,8 +122,6 @@ function neogen.jumpable(reverse)
|
|||||||
return neogen.utilities.cursor.jumpable(reverse)
|
return neogen.utilities.cursor.jumpable(reverse)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function neogen.generate_command()
|
function neogen.generate_command()
|
||||||
vim.api.nvim_command('command! -range -bar Neogen lua require("neogen").generate()')
|
vim.api.nvim_command('command! -range -bar Neogen lua require("neogen").generate()')
|
||||||
end
|
end
|
||||||
@@ -142,6 +140,7 @@ neogen.setup = function(opts)
|
|||||||
cpp = require("neogen.configurations.c"),
|
cpp = require("neogen.configurations.c"),
|
||||||
go = require("neogen.configurations.go"),
|
go = require("neogen.configurations.go"),
|
||||||
java = require("neogen.configurations.java"),
|
java = require("neogen.configurations.java"),
|
||||||
|
rust = require("neogen.configurations.rust"),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|||||||
36
lua/neogen/configurations/rust.lua
Normal file
36
lua/neogen/configurations/rust.lua
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
return {
|
||||||
|
parent = {
|
||||||
|
func = { "function_item" },
|
||||||
|
file = { "source_file" },
|
||||||
|
},
|
||||||
|
data = {
|
||||||
|
func = {
|
||||||
|
["function_item"] = {
|
||||||
|
["0"] = {
|
||||||
|
extract = function()
|
||||||
|
return {}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
file = {
|
||||||
|
["source_file"] = {
|
||||||
|
["0"] = {
|
||||||
|
extract = function()
|
||||||
|
return {}
|
||||||
|
end,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
|
template = {
|
||||||
|
annotation_convention = "rustdoc",
|
||||||
|
rustdoc = {
|
||||||
|
{ nil, "! $1", { no_results = true, type = { "file" } } },
|
||||||
|
{ nil, "", { no_results = true, type = { "file" } } },
|
||||||
|
|
||||||
|
{ nil, "/ $1", { no_results = true, type = { "func" } } },
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user