amir9480 / vscode-cpp-helper

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

Create implementation doesn't work (0.0.6) #5

Closed SergeyFi closed 4 years ago

SergeyFi commented 4 years ago

Hi, cool extension but on version 0.0.6 "Create implementation" doesn't work. On version 0.0.5 everything works fine. What information do I need to provide so that you can fix the bug?

VSCode version: 1.43.2 OS:Windows 10 x64.

amir9480 commented 4 years ago

Hello. Thanks for using C++ Helper.

First, check if you can see Function not detected. message when you click "Create implementation". If you see that then please send a sample header code that does not work and tell exactly where you right-clicked.

Otherwise, please follow these instructions. https://github.com/amir9480/vscode-cpp-helper/issues/1#issuecomment-603793422

SergeyFi commented 4 years ago

Hi. I followed the instructions and here is the result:

8667.log exthost-c85225.cpuprofile.txt

Code examples: NutrientsComponent.cpp.txt NutrientsComponent.h.txt

P.S I noticed that the implementation was eventually created, but with a big lag.

P.P.S I tried on another PC, a similar story. 85993234334.log exthost-aa8b87.cpuprofile.txt

amir9480 commented 4 years ago

I tested regex on your code and figured out this happening because of Unreal Engine macros like ( UCLASS, GENERATED_BODY, ... ) causing the problem because of no ";" at end of the line so regex takes too much time to parse.

I optimized regex based on your code and now it looks like working. Please update to version 0.0.7 and if still any issue exists let me know. Thank you.