Problem
The cpp language's FilenameMatcher in solidlsp/ls_config.py only matches C/C++ extensions:
case self.CPP | self.CPP_CCLS:
return FilenameMatcher("*.cpp", "*.h", "*.hpp", "*.c", "*.hxx", "*.cc", "*.cxx")
This means .m (Objective-C) and .mm (Objective-C++) files are not associated with clangd, even though clangd fully supports these file types.
Currently .m is mapped to MATLAB, which makes Objective-C source files inaccessible through the cpp language server.
Impact
For iOS/macOS projects, get_symbols_overview, find_symbol, and find_referencing_symbols all fail on .m and .mm files with:
ValueError - Cannot extract symbols from file xxx.m. Active languages: ['cpp']
While .h header files work fine (since they match *.h), the implementation files are completely excluded.
Suggested Fix
Add "*.m" and "*.mm" to the CPP FilenameMatcher:
case self.CPP | self.CPP_CCLS:
return FilenameMatcher("*.cpp", "*.h", "*.hpp", "*.c", "*.hxx", "*.cc", "*.cxx", "*.m", "*.mm")
Note: *.m currently conflicts with MATLAB. A possible solution is to either:
- Add
.m/.mm to cpp and remove .m from MATLAB (breaking change for MATLAB users)
- Allow configurable file extension overrides via
ls_specific_settings
- Add a dedicated
objc language alias that maps to clangd with ObjC extensions
Environment
- Serena version: 0.1.4
- Platform: macOS (ARM64)
- Use case: Cross-platform mobile SDK with C++, Objective-C++, and Kotlin code
Problem
The
cpplanguage'sFilenameMatcherinsolidlsp/ls_config.pyonly matches C/C++ extensions:This means
.m(Objective-C) and.mm(Objective-C++) files are not associated with clangd, even though clangd fully supports these file types.Currently
.mis mapped to MATLAB, which makes Objective-C source files inaccessible through thecpplanguage server.Impact
For iOS/macOS projects,
get_symbols_overview,find_symbol, andfind_referencing_symbolsall fail on.mand.mmfiles with:While
.hheader files work fine (since they match*.h), the implementation files are completely excluded.Suggested Fix
Add
"*.m"and"*.mm"to the CPP FilenameMatcher:Note:
*.mcurrently conflicts with MATLAB. A possible solution is to either:.m/.mmto cpp and remove.mfrom MATLAB (breaking change for MATLAB users)ls_specific_settingsobjclanguage alias that maps to clangd with ObjC extensionsEnvironment