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

not creating implementation in .cpp correctly #15

Closed BazzalSeed closed 3 years ago

BazzalSeed commented 4 years ago

My file layout is simply like this

Screen Shot 2020-06-19 at 5 27 34 PM

I changed the settings to this

Screen Shot 2020-06-19 at 5 28 14 PM

You can see, even though i click on create implementation. It's creating all the implementations in place in stead of in .cpp.

bug_impl Would appreciate your help

amir9480 commented 4 years ago

Hello @BazzalSeed

I'm not sure why this happening but I noticed you have an error in your JSON config.

[
...
"{FILE}.c",
]

You should remove the last comma in your array. Fix it and if still issue exists please let me know.

SuperUserDone commented 4 years ago

I have the same issue, it seems to be happening when class is in a namespace

dstodev commented 3 years ago

I'm having this same issue.

It seems like this happens when:

So, to test, I made this header:

#ifndef CLASS_H
#define CLASS_H

class Test
{
public:
    void func1();
    void func2();
};

#endif  // CLASS_H

Using "Create Implementation" works for func1, but then creating the implementation for func2 afterwards will put it in the header file instead of the .cpp file.

amir9480 commented 3 years ago

@dstodev Your information helped me a lot. Thank you.

@louis123456 @BazzalSeed

Please update to v0.2.2.