How to enable commenting of .asy files in Kate?
In the Kate editor, for some types of files, one can comment and uncomment lines by pressing Ctrl+D and Ctrl+Shift+D. But, in Kate's default configuration, this is not possible for .asy files (associated with Asymptote). Nothing happens if Ctrl+D is pressed (and also nothing happens if Ctrl+/ is pressed, and the 'Toggle comment' is grayed out in Tools).
The appropriate commenting symbol for .asy files is //.
I thought the solution could be if Kate had the proper highlighting .xml file for .asy files. I found the instructions for generating that file here. The relevant directory (the one containing the script asy-kate.sh) was a bit different for me (/usr/share/asymptote/ rather than /usr/local/share/asymptote). Also, the script asy-kate.sh needed the file asy-keywords.el, and was complaining that it was missing. I found that file elsewhere in my system (in /usr/share/emacs/site-lisp/) and I copied it to /usr/share/asymptote/. Now asy-kate.sh ran without problems, and produced a reasonable-looking asymptote.xml file.
The next question was where to put it. After some googling, two candidate directories turned up: ~/.kde/share/apps/katepart/syntax/ and ~/.local/share/katepart5/syntax/. I created them and placed asymptote.xml in both. I restarted Kate, but unfortunately the new .xml files seemed to have no effect: for one, nothing was highlighted in my .asy files, and, more important for my purposes, the Ctrl+D still wasn't working and 'Toggle comment' was still grayed out.
How can I configure kate so that Ctrl+D and Ctrl+Shift+D work properly with .asy files?
Here is my system:
Operating System: Kubuntu 20.04
KDE Plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.4.0-70-generic
OS Type: 64-bit
The Kate version is 19.12.3.