From de107768b10f05f30d2df508547f63410d71b7e8 Mon Sep 17 00:00:00 2001 From: moleium Date: Wed, 4 Mar 2026 13:30:33 +0300 Subject: [PATCH] Add .cppm (C++20 module interface) to C++ file extensions (#50667) `.cppm` is the widely used extension for C++20 module interface units, supported by MSVC, Clang, and GCC. Currently Zed doesn't recognize it as C++, so users get no syntax highlighting or LSP support. Changes: `crates/languages/src/cpp/config.toml`: add cppm to path_suffixes `crates/theme/src/icon_theme.rs`: add cppm to the C++ icon matcher https://github.com/search?q=path%3A*.cppm&type=code Release Notes: - N/A --- crates/languages/src/cpp/config.toml | 2 +- crates/theme/src/icon_theme.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/languages/src/cpp/config.toml b/crates/languages/src/cpp/config.toml index 10c36a6ded1e1f3a1204d1e15af47fee78b8e049..e2608a8ce5f17cb648e4f86dc27da60ed8bdd2ae 100644 --- a/crates/languages/src/cpp/config.toml +++ b/crates/languages/src/cpp/config.toml @@ -1,6 +1,6 @@ name = "C++" grammar = "cpp" -path_suffixes = ["cc", "hh", "cpp", "h", "hpp", "cxx", "hxx", "c++", "h++", "ipp", "inl", "ino", "ixx", "cu", "cuh", "C", "H"] +path_suffixes = ["cc", "hh", "cpp", "cppm", "h", "hpp", "cxx", "hxx", "c++", "h++", "ipp", "inl", "ino", "ixx", "cu", "cuh", "C", "H"] line_comments = ["// ", "/// ", "//! "] first_line_pattern = '^//.*-\*-\s*C\+\+\s*-\*-' decrease_indent_patterns = [ diff --git a/crates/theme/src/icon_theme.rs b/crates/theme/src/icon_theme.rs index 7c2d603281ec50c1daa6f21e1dc3487bfc394a67..121ff9d7d4fbd841315b89e631606c7e67bc5cde 100644 --- a/crates/theme/src/icon_theme.rs +++ b/crates/theme/src/icon_theme.rs @@ -89,7 +89,7 @@ const FILE_SUFFIXES_BY_ICON_KEY: &[(&str, &[&str])] = &[ ( "cpp", &[ - "c++", "h++", "cc", "cpp", "cxx", "hh", "hpp", "hxx", "inl", "ixx", + "c++", "h++", "cc", "cpp", "cppm", "cxx", "hh", "hpp", "hxx", "inl", "ixx", ], ), ("crystal", &["cr", "ecr"]),