-
-
Notifications
You must be signed in to change notification settings - Fork 54
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
Add support for C++ #19
Comments
Hello, sure we could, but I'm not sure the tree sitter queries are the same. I'll try to look into that |
Should be partially same because C++ contains |
Hmm, can you try adding c configuration for cpp and see if you can generate some annotations ? You can modify setup as so, to include support for cpp require('neogen').setup {
enabled = true,
languages = {
cpp = require("neogen.configurations.c")
}
} |
It works, thanks! |
Nice, so that means we can use the c configuration language, and apply more stuff for cpp.
What do you mean ? I need some extra information, or a snippet to reproduce it |
Quick example for testing: https://github.com/crow-translate/crow-translate/blob/400c2432e37f64e7c65b5fd87add02ce5b34a005/src/mainwindow.h#L159 Should contains |
And related question. I noticed that all params generated with void test(int &value); Generates: /**
* @brief
*
* @param[in] value
*/ But it should be: /**
* @brief
*
* @param[out] value
*/ But I think that you can't detect it with Treesitter. Could we generate it without direction annoation? /**
* @brief
*
* @param value
*/ |
Added support for variadic functions in cpp (as simple as doing this: e4e09d6 !), you can try it and tell me. |
About this, I don't really now, it was being worked in this PR: #14 |
Thank you, It works!
That is the problem. It is not always possible to tell. If you are passing something by pointer, it can be either |
I see. I think it'll be very difficult to get the information, as I would need to see if the parameter is being written to. |
Yep, this would be the best solution for now. |
Found another issue. If I try to generate the documentation for the following function: I get this: /* */
QKeySequence closeWindowShortcut() const; |
Is it supposed to supercharge a function ? I get this from Treesitter: If it's a type by it's own, I can create a new type for this, called |
What should I get instead ? |
/**
* @brief
*
* @return
*/ |
Looks like here are two separate issues.
|
I don't think it's an issue, it's a feature: neogen/lua/neogen/configurations/c.lua Lines 109 to 117 in d04b657
I mean, Treesitter does not tell me there is a return in your code snippet: |
If a declaration contains a type first, then it's a return value. Or do you think that this is a Treesitter bug?
But this probably shouldn't happen? We should always have a |
Here is an example of a function without a return type and without arguments: https://github.com/crow-translate/crow-translate/blob/400c2432e37f64e7c65b5fd87add02ce5b34a005/src/mainwindow.h#L145 |
To be more clear I expecting to get the following: /**
* @brief
*/ Instead of /* */ |
No I think I should add this feature on my end. But I do want to check if this is written in doxygen. Can you hint me a place where they confirm this ? |
Modified template in last commit e87b4a2 |
Thanks, now looks as expected!
If a function have |
Should I close it and open another issue about |
Yes, be sure to reference useful snippets to alleviate testing |
Done, thanks! |
The plugin is currently supports C, can we enable it for C++?
The text was updated successfully, but these errors were encountered: