Bug 398393 - Alerts (TODO, FIXME...) are TRUE for isCode()
Summary: Alerts (TODO, FIXME...) are TRUE for isCode()
Status: RESOLVED FIXED
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (show other bugs)
Version: 5.50.0
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-09-08 15:08 UTC by flyos
Modified: 2018-09-09 19:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In: 5.51


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description flyos 2018-09-08 15:08:59 UTC
When using the Javascript scripting API from Kate, you can test whether a part of the document is part of the code (and not, say, comments) using the function isCode().

However, when comments contain alert words such as FIXME, TODO or NOTE (defined in data/syntax/alert.xml), the alert words are TRUE for isCode() and comments are thus not appropriately ignored.

I believe this a bug as I don't see languages or contexts where such alert words would not be contained in comments and be actually part of the code. I thus believe the correct behaviour should be to return FALSE for isCode() for those alert words.
Comment 1 Dominik Haumann 2018-09-09 10:37:08 UTC
Git commit af5ebba716f53f11d0f3b9466f9c32e416a68fc5 by Dominik Haumann.
Committed on 09/09/2018 at 10:36.
Pushed by dhaumann into branch 'master'.

Scripting: isCode() returns false for dsAlert text

Summary: BUG: 398393

Test Plan: make && make test

Reviewers: cullmann

Reviewed By: cullmann

Subscribers: kwrite-devel, kde-frameworks-devel

Tags: #kate, #frameworks

Differential Revision: https://phabricator.kde.org/D15370

M  +1    -0    src/script/katescriptdocument.cpp

https://commits.kde.org/ktexteditor/af5ebba716f53f11d0f3b9466f9c32e416a68fc5