Add support for additional C++ file extensions from VSCode#3898
Add support for additional C++ file extensions from VSCode#3898Ikos3k wants to merge 1 commit intomicro-editor:masterfrom
Conversation
|
|
||
| detect: | ||
| filename: "(\\.c(c|pp|xx)$|\\.h(h|pp|xx)?$|\\.ii?$|\\.(def)$)" | ||
| filename: "(\\.c(c(m)?|pp(m)?|xx(m)?|\\+\\+m?)$|\\.h(\\+\\+|h|pp|xx)?$|\\.i(i)?$|\\.(def|ino|inl|ipp|ixx|tpp|txx)$|\\.h(pp)?\\.in$)" |
There was a problem hiding this comment.
I don't read or write C++ code, so I think you should not change anything based on this comment only and maybe wait until someone else comments.
A part of this change is good, since it seems to add filename extensions for C++20 modules. There currently seems to be a lot: https://stackoverflow.com/questions/75733706/what-is-the-file-extension-naming-convention-for-c20-modules
There are the only changes I suggest, from left to right in the changed line:
\\.c(c(m)?|pp(m)?|xx(m)?|\\+\\+m?)$→\\.c(c|pp|xx|\\+\\+)m?$\\.i(i)?$→\\.ii?$: Revert, since it should probably be understood as "basic" syntax of regex that this matchesexample.iino: Remove since this is likely for Arduino code, which has a different file in Micro:arduino.yaml
Maybe \.h(pp)?\\.in$ should be removed, since I'm not sure we should recognize .in now in cpp.yaml only. Instead, Micro should probably ignore this on all filetypes.
I believe .in can be files in any language, with text like @PREFIX@ which a project's build system replaces. Actual examples I've seen are configuration, scripts, and patches.
https://github.com/microsoft/vscode/blob/main/extensions/cpp/package.json#L31