amir9480 / vscode-cpp-helper

vscode extension to create implementation for c++ function prototypes.
https://marketplace.visualstudio.com/items?itemName=amiralizadeh9480.cpp-helper
MIT License
355 stars 31 forks source link

Fix function mismatch when header contains comments #48

Closed Geometror closed 2 years ago

Geometror commented 2 years ago

This PR fixes an issue where the implementation of the wrong function is generated (or the function wasn't found at all) in some cases when the header file contains comments. Tested this in several scenarios and it seems to work, but note that comments for parameters are now preserved. Please let me know if this solution proposes undesired behavior, so I can adjust it since this issue currently makes this (awesome) extension unusable for me :) Fixes #49 partially (only for line comments) Issue:

Animation (1)

This PR:

Animation2

abgironne commented 2 years ago

I confirm that this pull request fixed it for me. It would be usefull to merge and publish it. It must be pretty common to start a header file with comments.

amir9480 commented 2 years ago

@Geometror, @abgironne Thanks for your contributions.