Comments (3)
Hello ! I'm currently in the process of refactoring the codebase to expose more easily the annotation standards, and providing better docs for it !
But now, you can take a look Neogen works in c:
neogen/lua/neogen/configurations/c.lua
Lines 175 to 189 in 7b9157d
This is the template responsible for generating Doxygen in C. You can see that every second parameter of each table is a string, and note that:
$1
is the cursor placement%s
will be replaced by the value
So for you, the Doxygen table could be something like:
custom = {
{ nil, "/// @file", { no_results = true, type = { "file" } } },
{ nil, "/// @brief $1", { no_results = true, type = { "func", "file" } } },
{ nil, "", { no_results = true, type = { "file" } } },
{ nil, "/// @brief $1", { type = { "func" } } },
{ "tparam", "/// @tparam %s $1" },
{ "parameters", "/// @param %s $1" },
{ "return_statement", "/// @return $1" },
},
And to use in your Neogen setup:
require('neogen').setup {
enabled = true,
languages = {
c = {
template = {
annotation_convention = "custom",
custom = {
{ nil, "/// @file", { no_results = true, type = { "file" } } },
{ nil, "/// @brief $1", { no_results = true, type = { "func", "file" } } },
{ nil, "", { no_results = true, type = { "file" } } },
{ nil, "/// @brief $1", { type = { "func" } } },
{ "tparam", "/// @tparam %s $1" },
{ "parameters", "/// @param %s $1" },
{ "return_statement", "/// @return $1" },
},
}
},
...
}
}
Tell me if it works !
from neogen.
Thank you very much for the detailed answer. Works fine for me.
Except one copy paste thing: you set the template for lua instead of c or cpp.
require('neogen').setup {
enabled = true,
languages = {
cpp = {
template = {
annotation_convention = "custom",
custom = {
{ nil, "/// @file", { no_results = true, type = { "file" } } },
{ nil, "/// @brief $1", { no_results = true, type = { "func", "file" } } },
{ nil, "", { no_results = true, type = { "file" } } },
{ nil, "/// @brief $1", { type = { "func" } } },
{ "tparam", "/// @tparam %s $1" },
{ "parameters", "/// @param %s $1" },
{ "return_statement", "/// @return $1" },
},
}
},
}
}
from neogen.
Oh yeah right, fixed
from neogen.
Related Issues (20)
- Feature Request - Support NeoVim native snippet engine HOT 2
- `Invalid 'end_col': out of range` error whenever running `Neogen file` HOT 2
- Bug: handling of arbitrary args and kwargs with type hints HOT 1
- Allow generating explicit sections HOT 3
- Update / Correction command HOT 2
- Python - raise module_name.Error() is not detected
- Bug: Neogen not functioning in vue files. HOT 2
- Could not get neogen to work with LazyVim HOT 4
- Need unittests HOT 1
- Missing blank line in numpydoc
- Option to always disable writing argument types in Python HOT 2
- FR: support creating annotations in Markdown code blocks HOT 1
- Sometimes native snippets do not expand on tab
- Add support for records in C# HOT 2
- Support annotating interfaces HOT 2
- Help implementing doctrings for Julia HOT 4
- Annotate all nodes in a file or ones from visual selection HOT 1
- Fix Python bugs
- Use Release Please to simplify neogen versioning
- Python: Should Raises be after Return in google style? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from neogen.