Review Request 120085: Use only file extension to determine file type.

Sergey Kalinichev kalinichev.so.0 at gmail.com
Sun Sep 7 11:58:44 UTC 2014



> On Sept. 7, 2014, 1:01 p.m., Milian Wolff wrote:
> > Ugh I saw this happening as well at one point and was wondering whats going on. good find.
> > 
> > But I think the proper solution instead is to make the CMake plugin properly report the file extensions. Why is this not working? The loop before should already match CMakeLists.txt <-> CMake and the C++ plugin should never see the CMakeLists.txt. If that is not the case, we must find a way to better prioritize the cached data.
> > 
> > Otherwise this might break people's workflow when suddenly the mimetypes are not properly recognized anymore. Hm.

>Why is this not working? The loop before should already match CMakeLists.txt <-> CMake and the C++ plugin should never see the CMakeLists.txt.

Yeah, you are right, but before we never got to the point where CMake mime types were added to d->mimeTypeCache, as we always returned earlier, now it works though.


- Sergey


-----------------------------------------------------------
This is an automatically generated e-mail. To reply, visit:
https://git.reviewboard.kde.org/r/120085/#review65954
-----------------------------------------------------------


On Sept. 7, 2014, 3:58 p.m., Sergey Kalinichev wrote:
> 
> -----------------------------------------------------------
> This is an automatically generated e-mail. To reply, visit:
> https://git.reviewboard.kde.org/r/120085/
> -----------------------------------------------------------
> 
> (Updated Sept. 7, 2014, 3:58 p.m.)
> 
> 
> Review request for KDevelop.
> 
> 
> Repository: kdevplatform
> 
> 
> Description
> -------
> 
>  Real project example:
> someFile.txt begins with `/*`
> it considered as c++ file by KMimeType::findByUrl(url).
> Then we do: d->fileExtensionCache.insert(extension, languages); So now we think that c++ support can parse txt files.
>  Then there is a CMakeLists.txt file that is already parsed by cmake language support, but on project opening (or when opening it in the editor) we try to parse it again and see that it extension is `*.txt` and we already registered txt files as supported by c++ language support, so this file is being parsed by c++ language support, but as it already has context created by cmake support and we assume that it's created by us -> crash
> 
> 
> Diffs
> -----
> 
>   shell/languagecontroller.cpp 817c1ce 
> 
> Diff: https://git.reviewboard.kde.org/r/120085/diff/
> 
> 
> Testing
> -------
> 
> 
> Thanks,
> 
> Sergey Kalinichev
> 
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/kdevelop-devel/attachments/20140907/b84b98a8/attachment.html>


More information about the KDevelop-devel mailing list