Summary: | Turn off semantic analysis for GLSL (or fix it) | ||
---|---|---|---|
Product: | [Applications] kdevelop | Reporter: | Staffan Palmroos <spalmroos> |
Component: | Problem reporter | Assignee: | kdevelop-bugs-null |
Status: | CONFIRMED --- | ||
Severity: | wishlist | CC: | dbcongard, mail, max.schwarz |
Priority: | NOR | ||
Version First Reported In: | unspecified | ||
Target Milestone: | --- | ||
Platform: | Gentoo Packages | ||
OS: | Linux | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: | |||
Attachments: |
Test project for GLSL parsing issues
Screenshot of the problem |
Description
Staffan Palmroos
2017-09-27 00:09:23 UTC
Do you have an minimal working example which exhibits the problem? Created attachment 108063 [details]
Test project for GLSL parsing issues
Sure, here's one. It's not a complete program, just some vertex and fragment shaders that triggers the problem mentioned.
Created attachment 108064 [details]
Screenshot of the problem
Here is a screenshot of it. The Problem tab is full of errors because it parses it as C(++) code when it isn't.
The C++ file matching is extremely overzealous...see also: https://bugs.kde.org/show_bug.cgi?id=360081 "Attempting to parse text/plain files as C or C++" (reported by me) for *.nml files. https://bugs.kde.org/show_bug.cgi?id=381709 "Matlab script interpreted as C++" for *.m files. It also tries to parse TypeScript (*.ts), and generally anything remotely C-like. This occurs despite kmimetypefinder returning text/x-matlab, text/x-typescript etc. ArchLinux, KDevelop v5.3.3. The same issue. Editing is possible in some other program (it's good that KDevelop allows opening files by default in another program), but when I commit changes, these "errors" interfere. If someone found a solution to this problem, please share it. I fixed it as follows: 1. Right-click on the project 2. Configure project 3. Cppcheck 4. Include Directories 5. Ignored includes - here I pasted the path to the folder with shaders For me, adding a new MIME type "text/x-glsl" in system settings -> Applications -> File Associations with the appropriate file endings (e.g. *.glsl) helps. Then kmimetypefinder5 returns text/x-glsl instead of text/x-csrc. I had to clear out my kdevelop cache to remove any lingering error markers. |