Skip to content

Commit a3d50e1

Browse files
committed
Add more cpp extensions
1 parent 18e7e63 commit a3d50e1

1 file changed

Lines changed: 34 additions & 1 deletion

File tree

src/solidlsp/ls_config.py

Lines changed: 34 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,40 @@ def get_source_fn_matcher(self) -> FilenameMatcher:
232232
case self.RUBY_SOLARGRAPH:
233233
return FilenameMatcher("*.rb")
234234
case self.CPP | self.CPP_CCLS:
235-
return FilenameMatcher("*.cpp", "*.h", "*.hpp", "*.c", "*.hxx", "*.cc", "*.cxx")
235+
# From llvm-project/clang/lib/Driver/Types.cpp types::lookupTypeForExtension:
236+
return FilenameMatcher(
237+
# C
238+
"*.c",
239+
"*.C",
240+
"*.h",
241+
"*.H",
242+
# C++
243+
"*.c++",
244+
"*.C++",
245+
"*.c++m",
246+
"*.cc",
247+
"*.CC",
248+
"*.cp",
249+
"*.cpp",
250+
"*.CPP",
251+
"*.cxx",
252+
"*.CXX",
253+
"*.cxxm",
254+
"*.hpp",
255+
"*.hxx",
256+
"*.ixx",
257+
# CUDA
258+
"*.cu",
259+
# HIP
260+
"*.hip",
261+
# Objective-C
262+
"*.m",
263+
"*.M",
264+
"*.mm",
265+
# OpenCL
266+
"*.cl",
267+
"*.clcpp",
268+
)
236269
case self.KOTLIN:
237270
return FilenameMatcher("*.kt", "*.kts")
238271
case self.DART:

0 commit comments

Comments
 (0)