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

Generate a header file for editors to run IntelliSense normally while using C++20 named modules #4971

Open
vspefs opened this issue Apr 12, 2024 · 0 comments

Comments

@vspefs
Copy link

vspefs commented Apr 12, 2024

Is your feature request related to a problem? Please describe.

Most editors don't provide decent IntelliSense for imported named modules in C++, especially when it comes to remote packages, as for which accessing and indexing those declarations through different build systems and package managers could be tricky.

Describe the solution you'd like

However, a compromise can be made, to create some sort of compatibility. We can generate a header file that includes all the class declarations of the libraries used, function declarations and so on, as a by-product of the processing of modules. The file may look like this:

#ifdef _EDITOR
class A
{
public:
    int func(const char* str, int num);
    //....
}
#endif

And it's simple to undefine the macro when actually building our targets, so we can safely #include this file in our source files.

Describe alternatives you've considered

No response

Additional context

No response

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

No branches or pull requests

1 participant