Bug 393604 - Disable semantic analysis on a per file basis
Summary: Disable semantic analysis on a per file basis
Status: REPORTED
Alias: None
Product: kdevelop
Classification: Applications
Component: UI: general (show other bugs)
Version: 5.7.211203
Platform: Kubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: kdevelop-bugs-null
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-04-28 10:12 UTC by rohan.preacher.smith
Modified: 2022-12-02 04:04 UTC (History)
2 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description rohan.preacher.smith 2018-04-28 10:12:17 UTC
Semantic analysis is great, except when it generates an error on every line due to doing some code when you're missing headers such as on a different system than where the code is built. I would like to disable semantic analysis on this file but there doesn't seem to be any way to do that, or even to disable semantic analysis at all. There are options in "Configure KDevelop" -> "Language Support" to disable highlighting of problems, but those problems will still cause a pop-up to appear when you mouse over them in the source code.

Ideally, I think this would appear in the right click menu similar to "Reformat Source", with the global option appearing in the "Analyze" menu.
Comment 1 Sven Brauch 2018-04-28 17:20:45 UTC
I think "touch .kdev_ignore" still works for directories. There is also the 
#ifndef IN_IDE_PARSER ... #endif trick. Another workaround would be to use a different file ending for these files (e.g. .c_arm), although that may of course confuse other tools.

Other than that, I could imagine that an option could be added to the project filter plugin which does this ("exclude and do not parse" or so) ...
With the right-click menu, the problem I see is a bit that you do not have a UI which visualizes the current state of what is being ignored.

How the problem tooltips work needs rework anyways, though, they are relatively annoying right now.
Comment 2 Justin Zobel 2022-12-02 01:23:05 UTC
Thank you for reporting this issue in KDE software. As it has been a while since this issue was reported, can we please ask you to see if you can reproduce the issue with a recent software version?

If you can reproduce the issue, please change the status to "REPORTED" when replying. Thank you!
Comment 3 rohan.preacher.smith 2022-12-02 04:04:38 UTC
The situation has improved in some ways by showing the errors on the end of the line where the error is detected, however I am still unable to find any way to disable `Semantic analysis` on a per file basis, or even in the entire project. Sven's suggestion of using the `Project Filter` plugin to exclude files doesn't work on specific files as they are still part of the project. His suggestion to use a different file extension also doesn't seem to work as the semantic analysis is still reporting errors even after changing the extension, as though it is analysing it as C.

I would still like to be able to right click in a given file and have an option to disable semantic analysis on this file.