Bug 470672

Summary: Attempt to run external tool on freshly created and unsaved file fails because no file provided to said tool
Product: [Applications] kate Reporter: mikhaeldanilov <mikhael.danilov>
Component: applicationAssignee: KWrite Developers <kwrite-bugs-null>
Status: RESOLVED NOT A BUG    
Severity: normal CC: justin.zobel, waqar.17a
Priority: NOR    
Version First Reported In: 21.12.3   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed/Implemented In:
Sentry Crash Report:
Attachments: json format full file stdin

Description mikhaeldanilov 2023-06-05 15:32:55 UTC
STEPS TO REPRODUCE:
1.  Run Kate
2.  Create new  (ctrl + N)
3.  Write something in
4. Try to Tools->External Tools->Tools->JSON Full File Format

OBSERVED RESULT:
'Malformed URL' error was displayed.

EXPECTED RESULT:
Json formatting was applied to editor contents.
Comment 1 Justin Zobel 2023-06-06 02:20:02 UTC
I am unable to replicate this on Kate 23.04.1. Can you please try using a snap or flatpak version of Kate as 21.12.3 is quite old and this issue is quite possibly already fixed.
Comment 2 Waqar Ahmed 2023-06-06 07:05:18 UTC
You need to change the tool configuration so that it can read from STDIN. This is fixed in a later version AFAIR.

Pasting a screenshot of what the config should look like.

Alternatively, consider upgrading to the latest Kate version which has  a formatting plugin that does the job in a much better way.
Comment 3 Waqar Ahmed 2023-06-06 07:05:42 UTC
Created attachment 159489 [details]
json format full file stdin