@@ -24,7 +24,7 @@ const root = path.resolve(process.cwd());
2424
2525test ( "declares the official clangd dependency and mcpp commands" , ( ) => {
2626 const manifest = JSON . parse ( readFileSync ( path . join ( root , "package.json" ) , "utf8" ) ) as PackageManifest ;
27- assert . equal ( manifest . version , "0.2.2 " ) ;
27+ assert . equal ( manifest . version , "0.2.3 " ) ;
2828 assert . ok ( manifest . extensionDependencies ?. includes ( "llvm-vs-code-extensions.vscode-clangd" ) ) ;
2929 assert . ok ( manifest . activationEvents ?. includes ( "workspaceContains:mcpp.toml" ) ) ;
3030 assert . equal ( manifest . capabilities ?. untrustedWorkspaces ?. supported , "limited" ) ;
@@ -52,13 +52,24 @@ test("declares the official clangd dependency and mcpp commands", () => {
5252 assert . ok ( manifest . contributes ?. configuration ?. properties ?. [ "mcpp.path" ] ) ;
5353 assert . ok ( manifest . contributes ?. configuration ?. properties ?. [ "mcpp.modulesSupport" ] ) ;
5454 assert . deepEqual ( manifest . contributes ?. configurationDefaults ?. [ "files.associations" ] , {
55+ "build.mcpp" : "cpp" ,
5556 "*.ccm" : "cpp" ,
5657 "*.cppm" : "cpp" ,
5758 "*.ixx" : "cpp" ,
5859 "*.mpp" : "cpp" ,
5960 } ) ;
6061} ) ;
6162
63+ test ( "associates the build.mcpp file with the C++ language" , ( ) => {
64+ const manifest = JSON . parse ( readFileSync ( path . join ( root , "package.json" ) , "utf8" ) ) as PackageManifest ;
65+ const associations = manifest . contributes ?. configurationDefaults ?. [ "files.associations" ] as
66+ | Record < string , string >
67+ | undefined ;
68+
69+ assert . equal ( associations ?. [ "build.mcpp" ] , "cpp" ) ;
70+ assert . equal ( associations ?. [ "*.mcpp" ] , undefined ) ;
71+ } ) ;
72+
6273test ( "ships an injection grammar with module-specific scopes" , ( ) => {
6374 const manifest = JSON . parse ( readFileSync ( path . join ( root , "package.json" ) , "utf8" ) ) as PackageManifest ;
6475 const grammar = manifest . contributes ?. grammars ?. find ( ( item ) => item . scopeName === "source.cpp.mcpp-modules" ) ;
0 commit comments