Repository navigation
Add CppModulesProject test scenario for C++20 modules groundwork - #14837
Open
soroshsabz wants to merge 5 commits into
Open
soroshsabz wants to merge 5 commits into
soroshsabz wants to merge 5 commits into
Conversation
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The tests do not establish compilation-database use or preservation of delivered module arguments.
2 open findings
What changed in this PR
Adds C++20 modules test groundwork for extension-side behavior while semantic module-import support remains under development.
Changes:
- Adds file-classification, compilation-database, and custom-provider tests.
- Adds module fixtures and fake compiler assets.
- Runs the scenario in Windows CI.
| File | Description |
|---|---|
| Extension/test/scenarios/CppModulesProject/tests/modules.integration.test.ts | Adds module scenario tests. |
| Extension/test/scenarios/CppModulesProject/assets/math.ixx | Adds geometry module interface. |
| Extension/test/scenarios/CppModulesProject/assets/math.cppm | Adds math module interface. |
| Extension/test/scenarios/CppModulesProject/assets/main3.cpp | Adds MSVC-provider importer. |
| Extension/test/scenarios/CppModulesProject/assets/main2.cpp | Adds GCC-provider importer. |
| Extension/test/scenarios/CppModulesProject/assets/main.cpp | Adds compilation-database importer. |
| Extension/test/scenarios/CppModulesProject/assets/bin/gcc.exe | Adds Windows fake compiler. |
| Extension/test/scenarios/CppModulesProject/assets/bin/gcc | Adds non-Windows fake compiler. |
| Extension/test/scenarios/CppModulesProject/assets/.gitignore | Ignores generated configuration files. |
| .github/workflows/job-compile-and-test.yml | Adds Windows scenario execution. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Motivation
IntelliSense support for C++20 modules importing (#6302) is still in development on the language server side. Meanwhile, module-based projects already exercise extension-side behavior that currently has no test coverage:
.cppm/.ixx) being recognized as C++ sources,compile_commands.jsonentries containing GCC module flags (-fmodules-ts,-fprebuilt-module-path,-fmodule-file) not preventing IntelliSense,This PR adds a
CppModulesProjecttest scenario that locks that behavior in. It makes no statement about the semantic understanding of module imports by the language server — when server-side support lands, these tests are the natural place to add the end-to-end module IntelliSense assertions.What the tests cover
.cppm/.ixxfiles open with thecpplanguage id (guards the file associations that module files depend on for any IntelliSense at all).compile_commands.jsonwith GCC module flags — a runtime-generatedcompile_commands.json(with the fakegccchecked into the scenario assets, following theSimpleCppProjectpattern) carries the GCC module flags for an importer and two module interface units; IntelliSense reachesIntelliSenseReadyfor the importer.-fmodules-ts,-fprebuilt-module-path=...,-fmodule-file=...) and MSVC-style (/ifcSearchDir,/reference,/headerUnit,/stdIfcDir) module arguments; the tests assert the configurations are accepted/delivered and the files become ready. The extension-side handling that carries the MSVC modules workaround around has regressed before (the/ifcSearchDir//referenceprocessing regression discussed in Add IntelliSense for C++20 modules importing #6302), so this is worth guarding.Notes
yarn test --scenario=CppModulesProject) mirroring the existingSimpleCppProjectstep. Happy to drop it or extend it to other platforms per maintainer preference.Related: #6302