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

Robert N 5 Reputation points
2023-11-21T19:18:27.6033333+00:00

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?

Rob

Developer technologies | C++
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Minxin Yu 13,506 Reputation points Microsoft External Staff
    2023-11-22T02:58:08.89+00:00

    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

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.