-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 the ability to generate definitions from declarations and vice versa #664
Comments
I was going to suggest something very similar. I'd also be interested in a feature to create a header- and source-file pair with a single task invocation. This would be similar to XCode, for example, which generates both a |
Yeah, I have seen this feedback a few times in our survey responses. It is on my radar. |
Would love to have this feature! |
Upvote! |
Is this something you are looking for?: It is able to preserve existing methods and inclusions https://github.com/reignofwebber/vscode-c-cpp-definition-generator |
@exocode yep! your work? |
Can't wait to have this implemented. Such a basic feature, yet very useful. |
Can't wait to use it. |
@1354092549 Yes, but we don't have it on our schedule yet. |
it would be really useful feature :) |
I would love that! |
@davidbitton sorry, no.. some other genius did that for all of us :-) |
Just upVote it, and it woud be better to have it with funcitonality like "changing signature". |
Very related: Move implementation to source file (possibly creating it) which not only generates the signature but also moves the implementation from header to source. |
This feature is available for preview. Switch to the prerelease version of the C/C++ extension to install version 1.13.4 and give it a try. There are a few known issues with the first implementation documented here: https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.4. |
Filed an issue related to the new functionality: #10189 |
@khlebnikov thanks! We're looking into it. |
Hello! Is this feature released for the general public? |
@tirupatihemanth Please read #664 (comment) First release version of the extension to include it was https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.6, and https://github.com/microsoft/vscode-cpptools/releases/tag/v1.13.8 is the current latest version of the extension. |
@pfeerick Thank you for the reply. I have the v1.13.8 of cpp extension. I am using gcc compiler on the windows machine. |
@tirupatihemanth Do you see the "..." under the start of the declaration of the methods that aren't implemented yet? Like in this screenshot? |
@sean-mcmanus Yes I get that for function declarations in a class. |
@tirupatihemanth The feature works for you on a function declaration, right? It doesn't work when on a usage of a function that is not defined because our parser will see the identifier as just being undefined. |
@sean-mcmanus Yes it works for function declarations. It would be super useful if it suggests to generate definition of an undefined function on usage. |
I've filed a feature request on VS at https://developercommunity.visualstudio.com/t/Add-support-for-Create-Declaration--Def/10242237 . |
Other than genenrating function definition one by one, we need to generate a whole cpp files from the header. i.e. After we finish the declaration of a class or some functions in .h, we can create a .cpp with those definitions there. The extention c/c++ definition generator extenstion implements some functions, but far away from perfect. It would be great if cpptool adding such a feature. |
I spend a lot of time typing out lists of arguments (or copying and pasting them) when I'm defining functions that have already been declared in a header file. It would be nice if cpptools could automatically generate a skeleton definition of a function that has already been declared, or at least provide a shortcut to auto-fill the argument list.
The text was updated successfully, but these errors were encountered: