Can I tell Visual Studio that a certain file extension is a C++ module interface?

Robert N 0 Reputation points

I have been working on a C++ project with clang. For modules, their documentation recommended file extensions like the traditional C++ extensions, but with an "m" attached. So: .cppm, or .ccm, etc. Since I had been using .cc, I started using .ccm.

Now I've moved to Visual Studio, and it wants to see .ixx for primary and partition interface files. I see I can go to a file's properties and manually set its "Item Type" and then "Compile As", which lets me force it to treat anything as a module interface file, regardless of the file extension. But the icons in the explorer still look different. Is there a way to tell it to treat some other extensions like it treats .ixx?


A high-level, general-purpose programming language, created as an extension of the C programming language, that has object-oriented, generic, and functional features in addition to facilities for low-level memory manipulation.
3,626 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 10,791 Reputation points Microsoft Vendor

    Hi, @Robert N

    The icon can be set by File type.
    User's image

    Such as C/C++ Code:

    enter image description here

    Currently, the module file type is shown as document, no module type is listed.
    I'm afraid displaying module icon is not supported.

    Best regards,

    Minxin Yu

    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments