Disable analysis for lexer files?

Igor Kushnir igorkuo at gmail.com
Sat Oct 18 10:02:20 BST 2025


On 2025-10-17 10:45 PM, Jason Perry wrote:
> Hi,
> 
> KDevelop is doing semantic analysis on the Flex lexer file (extension .ll) in my 
> C++ terminal project, and generating lots of incorrect warnings because it 
> doesn't understand the format. I switched the file mode to "Lex/Flex" and 
> disabled the analyzer plugins, but still it is happening. Is there a way to turn 
> analysis off for a specific file or file type? Thanks.
> 
> Jason
> 

Hi Jason,

KDevelop parses files based on their MIME type, not the KTextEditor file mode. 
Check the MIME type of your file, e.g. via command `mimetype /path/to/file.ll`

An `#include` or a C/C++ comment at the top of a file can turn its MIME type 
into e.g. text/x-csrc. You can either modify the file to change its MIME type or 
add MIME type rule(s) based on the file extension (.ll) and/or contents. If you 
come up with good and general rules, you can contribute them to the Shared MIME 
Info database [1].

If the LSP Client plugin rather than KDevelop itself analyzes your file, you can 
disable the plugin or tweak its settings.

[1]: https://gitlab.freedesktop.org/xdg/shared-mime-info/

Cheers,
Igor


More information about the KDevelop-devel mailing list