| Summary: | Matlab script interpreted as C++ | ||
|---|---|---|---|
| Product: | [Applications] kdevelop | Reporter: | peje66 |
| Component: | All editors | Assignee: | kdevelop-bugs-null |
| Status: | CONFIRMED --- | ||
| Severity: | normal | CC: | geetam.chawla, igorkuo, mail |
| Priority: | NOR | ||
| Version First Reported In: | git master | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
| Attachments: | Imge of Matlab script showing erroneous C++-problems | ||
I just tried, the issue is reproducible here ... not sure what is responsible for that :/ @Sven: For me it is only reproducible if I add it to a session which has existing cpp projects, if a new session is created for matlab project(s), matlab scripts are not interpreted as cpp. *.m is registered as both a Matlab and an Objective-C MIME type extension. kdevelop/plugins/clang/kdevclangsupport.json contains "text/x-objcsrc" among X-KDevelop-SupportedMimeTypes. When any file parsed by KDevelop's Clang plugin is loaded (C, C++ or Objective-C), LanguageController adds all of the plugin's supported extensions into the MimeTypeCache. The cache is consulted before MIME type detection. So it returns ClangSupport for any *.m file afterward. Note that the MimeTypeCache is not just an optimization. Simply removing the cache would make LanguageController::languagesForUrl() always return an empty list in a background thread because of an early return required for thread safety. |
Created attachment 106331 [details] Imge of Matlab script showing erroneous C++-problems If I load a matlab-script in kdevelop it's parsed as C++-code and generates a ton of warnings. Se image. All the markings in the editor window is distracting. Document is marked as Tools->Mode->Scientific->Matlab "kmimetypefinder5 reformat_flux.m" reports "text/x-matlab"