Bug 439835 - VHDL text highlighting problem after "abs" and "not" operator overload
Summary: VHDL text highlighting problem after "abs" and "not" operator overload
Status: RESOLVED DOWNSTREAM
Alias: None
Product: frameworks-syntax-highlighting
Classification: Frameworks and Libraries
Component: syntax (other bugs)
Version First Reported In: unspecified
Platform: Mint (Ubuntu based) Linux
: NOR normal
Target Milestone: ---
Assignee: KWrite Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-07-14 10:04 UTC by vp.accounts
Modified: 2021-07-24 11:05 UTC (History)
3 users (show)

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


Attachments
Kate 20.12.2 with correct vhdl highlighting (62.43 KB, image/png)
2021-07-18 13:51 UTC, Jan Paul Batrina
Details

Note You need to log in before you can comment on or make changes to this bug.
Description vp.accounts 2021-07-14 10:04:01 UTC
SUMMARY
When a vhdl package defines an overload of trxtual operators such as "abs" "not" and several others, the text highlighting of the file becomes corrupted and all following text is highlighted with the color assigned to "Vector" style

STEPS TO REPRODUCE
1. create a vhdl file with .vhdl extension, such as my_file.vhdl
2. copy and paste the following example package declaration:

library IEEE;
use IEEE.STD_LOGIC_1164.ALL;
use IEEE.NUMERIC_STD.all;
use IEEE.MATH_REAL.all;

package kate_bug_test_pkg is
	
	function my_func_1(x: signed) return signed;
	function my_func_2(x: signed) return signed;
	function my_func_3(x: signed) return signed;
	
	function "abs" (x: signed) return signed;
	function "not" (x: signed) return signed;

	function my_func_4(x: signed) return signed;
	function my_func_5(x: signed) return signed;
	function my_func_6(x: signed) return signed;
	
end kate_bug_test_pkg;

3. Save the file

OBSERVED RESULT

after the line where "abs" is declared everything is highlighted as Vector style and not in the proper colors as before the "abs" declaration

EXPECTED RESULT

The highlighting should be consistent throughout the file

SOFTWARE/OS VERSIONS

Linux/KDE Plasma: Linux Mint 20.2 Cinnamon
Comment 1 Jan Paul Batrina 2021-07-18 13:51:18 UTC
Created attachment 140162 [details]
Kate 20.12.2 with correct vhdl highlighting

Hello, thanks for the bug report!

I'm not too familiar with VHDL, but I think the screenshot attached (Kate 20.12.2) shows correct highlighting.

It is possible that linux mint's kate/ktextditor/syntax-highlighting version is too old (libkf5syntaxhighlighting5 in Ubuntu 20.04 repos is version 5.68, released March 2020) and the fix might already be in newer versions. Try if kate's appimage (https://binary-factory.kde.org/job/Kate_Release_appimage/) exhibits the same problem
Comment 2 Jan Paul Batrina 2021-07-22 14:36:47 UTC
I can verify the issue on a Linux Mint 20.2 Live USB, which has Kate version 19.12.3 and KSyntaxHighlighting 5.68. The issue has already been fixed on later versions, so you might have to use the AppImage/Snap (https://kate-editor.org/get-it/), or build Kate/KSyntaxHighlighting manually since it is improbable that LM/Ubuntu will update the packages.
Comment 3 vp.accounts 2021-07-24 11:05:51 UTC
Perfect, thank you so much for addressing this issue so quickly