Bug 398393

Summary: Alerts (TODO, FIXME...) are TRUE for isCode()
Product: [Frameworks and Libraries] frameworks-syntax-highlighting Reporter: flyos
Component: syntaxAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED FIXED    
Severity: normal CC: christoph
Priority: NOR    
Version: 5.50.0   
Target Milestone: ---   
Platform: Other   
OS: Linux   
Latest Commit: Version Fixed In: 5.51
Sentry Crash Report:

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