Bug 347449 - Attempting to parse non-python files
Summary: Attempting to parse non-python files
Status: RESOLVED WORKSFORME
Alias: None
Product: kdev-python
Classification: Developer tools
Component: Language support (show other bugs)
Version: 1.7.1
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: Sven Brauch
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-05-08 22:22 UTC by Francis Herne
Modified: 2016-03-04 17:23 UTC (History)
0 users

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 Francis Herne 2015-05-08 22:22:27 UTC
The project I'm working on has some files with a ".pynml" extension. These don't contain valid python code, so parsing them is pointless and leads to error underlinings and randomly highlighted areas.

Doesn't seem to be a mimetype issue - 'file name.pynml' gives simply "name.pynml: ASCII text" compared to "name.py:  Python script, ASCII text executable" for an actual python file.

Possibly it's incorrectly matching the start of the suffix?

Reproducible: Always

Steps to Reproduce:
1. Have a file named *.pynml (or presumably *.py*)
2. Open it in KDevelop with kdev-python installed

Actual Results:  
kdev-python attempts to parse file, produces nonsensical highlighting and errors

Expected Results:  
kdev-python ignores non-python file and doesn't attempt to parse it
Comment 1 Francis Herne 2015-05-08 22:24:27 UTC
Remembering to check the actual mimetypes, it's text/plain vs text/x-python.
Comment 2 Sven Brauch 2015-05-08 23:31:40 UTC
Hmm. Strange, it should only parse files with mimetype text/x-python. It also does this correctly for me:

kdevplatform (language) KDevelop::BackgroundParserPrivate::createParseJob: found no languages for url KUrl("file:///tmp/test.pynml")
Comment 3 Francis Herne 2015-05-09 00:47:18 UTC
Odd.
Files in question: https://dev.openttdcoop.org/projects/road-hog/repository/show/src/templates
Comment 4 Sven Brauch 2015-10-08 18:28:52 UTC
I could never reproduce this, if it still exists, please reopen
Comment 5 Francis Herne 2016-03-04 17:23:17 UTC
Sorry, looking at the same problem now it seems to be caused by the C++ parser, so I was probably mistaken when filing this.

Re-filed against the C++ parser as https://bugs.kde.org/show_bug.cgi?id=360081