Skip to content
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

The extension fails to find the source file when it's not in "an obvious location". #54

Open
HTD opened this issue Jun 15, 2022 · 2 comments

Comments

@HTD
Copy link

HTD commented Jun 15, 2022

I have a complicated project where the header and source files are not in the same directory, and they more than one directory level away from each other. However, the include directories are properly configured in the project settings.

The default switch "header / source" option in VS doesn't work, however, I installed a different extension (first match) for the search "header source" and it works.

I know the proper way to find the source is to consider include directories in the project settings, then look for the C / C++ file that includes the current header and its name matches the header name.

Somehow it's not what this extension does, since it doesn't find my source file. So for now I can create the implementation in the header file and then manually move it to the source file.

@amir9480
Copy link
Owner

@HTD You should change CppHelper.SourcePattern configuration so the extension can find your source.

The default configuration seems not to fit your project.
https://github.com/amir9480/vscode-cpp-helper/blob/master/package.json#L77

@knetworx
Copy link
Contributor

knetworx commented Jun 28, 2023

In my Unreal project, I've got files that look like this:
C:\BaseFolder\Unreal\GameName\Source\GameName\Private\SomeFolder\SomeOtherFolder\MyFile.cpp
C:\BaseFolder\Unreal\GameName\Source\GameName\Public\SomeFolder\SomeOtherFolder\MyFile.h
Doing a bit of experimentation, I've figured out that I can get it to work by using
"/GameName/Source/GameName/Private/SomeFolder/SomeOtherFolder/{FILE}.cpp"
but I don't seem to be able to use directory wildcards, e.g.
"/GameName/Source/GameName/Private/**/{FILE}.cpp"
Is there any other way to make it more generic so I don't have to list every subdirectory (there are quite a few in the project, and new ones are added frequently)?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants