[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kdevelop-bugs
Subject:    [Bug 294984] New: Re-evaluate file MIME type to enable language support when files are opened for ed
From:       Eike Hein <hein () kde ! org>
Date:       2012-02-28 9:15:54
Message-ID: bug-294984-40295 () http ! bugs ! kde ! org/
[Download RAW message or body]

https://bugs.kde.org/show_bug.cgi?id=294984

           Summary: Re-evaluate file MIME type to enable language support
                    when files are opened for editing
           Product: kdevplatform
           Version: git master
          Platform: Unlisted Binaries
        OS/Version: Linux
            Status: NEW
          Severity: normal
          Priority: NOR
         Component: language
        AssignedTo: kdevelop-bugs@kdevelop.org
        ReportedBy: hein@kde.org


KDev* currently doesn't use the full MIME type discovery abilities of the KDE
Platform libaries for performance reasons. Instead of having the library look
at file contents in addition to file extensions to determine a file's MIME
type, MIME types are determined solely by file extensions.

This is a problem for projects with extension-less code files. Right now, this
problem is commonly seen with Python projects: While Python program units (i.e.
modules) usually have a .py extension, the main "executable" file of a Python
project is often extension-less. While the KDE Platform can correctly identify
such a file as Python by looking at the contents, KDev* doesn't make use of
this.

The reason for this is that KDev* has to potentially open and scan many files
to build the DUChain data structures; potentially thousands. Allowing the KDE
Platform to open and read file contents has proven too slow in practice with
that number of files.

The proposed workaround to solve this problem is to implement a compromise
solution: MIME types will continue to be identified solely by extension
initially, but once a file is opened for editing, its MIME type will be
re-evaluated using the full spectrum of identication options. As the file has
to be opened and read anyway at this point, the performance cost is negligible
due to caching, plus a far smaller number of files is actually edited rather
than just scanned. If the determined MIME type has changed vs. the initial
identification, the relevant parts of the DUChain will then need to be evicted
and rebuilt.

-- 
Configure bugmail: https://bugs.kde.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

_______________________________________________
KDevelop-bugs mailing list
KDevelop-bugs@kdevelop.org
https://barney.cs.uni-potsdam.de/mailman/listinfo/kdevelop-bugs
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic