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

Not working on vscode 1.43.1 #1

Closed lp35 closed 4 years ago

lp35 commented 4 years ago

Hi,

First thank you for working on this missing feature of vscode.

I can't get this extension working though. Right clicking on the declaration and clicking "Create implementation" does not give any error nor result.

on a side not, it is also impossible for me to set

"CppHelper.SourcePattern": [
    "{FILE}.cpp",
    "{FILE}.c",
    "{FILE}.inl",
    "/src/{FILE}.cpp"
]

in my settings:

image

Thanks for your help.

amir9480 commented 4 years ago

Hello @lp35 Thanks for using my extension and sorry for English in advance.

First, for the configuration, I checked and that is because of a mistake in package.json. I gonna fix that as soon as possible and you can ignore the warning for now.

And for the implementation, I need more information to debug. Please send me your sample header code and tell me exactly where you right-clicked so that I can check that with my regexes that I created for extension.

lp35 commented 4 years ago
#ifndef ABOUTDIALOG_HPP
#define ABOUTDIALOG_HPP

#include <QDialog>

namespace Ui {
class AboutDialog;
}

class AboutDialog : public QDialog
{
    Q_OBJECT

public:
    explicit AboutDialog(QWidget *parent = 0);
    virtual ~AboutDialog();
    void test();

private:
    Ui::AboutDialog *ui;
};

#endif // ABOUTDIALOG_HPP

I put my mouse on test function and it does not generate anything...

amir9480 commented 4 years ago

@lp35 I tested your code on my vscode and this is the result. screenshot

Look like the problem is something else.

First, if you are using a Linux distribution OS check #2,

Otherwise, Please do these and send me the result.

At last, you can enable your extensions by command Extensions: Enable All Extensions.

Thanks.

Screenshots: image image image image image image image

lp35 commented 4 years ago

EDIT: sorry didn't saw that you mentionned #2. It's indeed the same issue!

Hey,

Thank you for pointing me on the developer console. I guess I've found the bug:

image

I think you are doing your tests under MS Windows, where the NTFS filesystem is case insensitive. Your extension is looking for Helpers.js, and in my extension folder under my home directory ~/.vscode/extensions/amiralizadeh9480.cpp-helper-0.0.4/out, it is helpers.js

Renaming files with the correct case fixes the problem, and I'm now able to generate methods. You should then update your file to respect the case.

Thank you very much, and good luck against Covid19, I've seen that your country is particularly affected. We pray for you guys.

Regards

amir9480 commented 4 years ago

Hi.

The issue solved in v0.0.5. The problem was I changed helpers.ts to Helpers.ts before but compiled file name was still helpers.js (Thanks to windows filesystem!). So I cleared compiled files and recompiled my codes. I tested on Ubuntu 18.04 and v0.0.5 works fine.

⭐🌟⭐ 😉 👆