~hadronized/kak-tree-sitter-bugs#15: 
kak-tree-sitter 1.1.1 doesn't keep applying to newly opened files

If I open multiple files, either from one kakoune session, or from new kakoune clients connected to the same server, kts eventually stops applying to any newly opened files. It normally only takes 1-3 files beyond the first. Additionally, the default highlighting isn't applied either.

The first opened file always works as intended. It initially appears with both kts + default highlighting (or maybe default only?), but after a brief delay, the default highlighting is automatically removed and the file is highlighted by tree-sitter.

I get this in my *debug* buffer for each (cpp) file that shows up without any highlighting:

error running hook WinSetOption(tree_sitter_lang=cpp)/tree-sitter: 2:18: 'remove-highlighter': no such id: 'cpp'

Perhaps whatever code that is meant to strip the default highlighter is throwing an error, and then kts doesn't apply either?

As an aside, the documentation here is out of date: https://git.sr.ht/~hadronized/kak-tree-sitter/tree/HEAD/item/docs/man/commands.md

Status
RESOLVED INVALID
Submitter
~chriselrod
Assigned to
No-one
Submitted
8 months ago
Updated
a month ago
Labels
cant-reproduce kak-tree-sitter prio:high

~hadronized 8 months ago

I’m not sure I have ever seen that. I’ll try to see whether I can reproduce.

~chriselrod 8 months ago*

I see it every time, normally with the 2nd opened file. I have not found a means of not reproducing, other than downgrading to kak-tree-sitter 1.0.1, and dealing with needing to occasionally rmhl window/cpp.

My suspicion is that whenever I need to manually :rmhl window/cpp on kts 1.0.1 (not often), kts 1.1.1 would work as intended. Whenever I don't need to :rmhl window/cpp on 1.0.1 (vast majority of the time), kts 1.1.1 would yield

error running hook WinSetOption(tree_sitter_lang=cpp)/tree-sitter: 2:18: 'remove-highlighter': no such id: 'cpp'

and there would be neither default nor kts highlighting of the window.

I have this suspicion because on kts 1.0.1, I normally only need to rmhl the first opened file. On kts 1.1.1, I see it remove the default highlighting after a short lag on the first file, which is normally the only file that works. Additionally, the error message is about a failure to remove the default cpp highlighter. It seems like removing the default highlighter isn't typically needed except for the first opened file, and that the error when trying to do so unsuccessfully prevents the kts highlighters from getting applied.

Additionally, when I start the server from the command line:

$ kak-tree-sitter -vvvv -s --with-highlighting --with-text-objects

I see nothing being printed for any of the cpp files that fail to display anything. I suspect the kak script errors out before passing any messages to the server.

~hadronized 3 months ago

Do you still reproduce even today?

~hadronized REPORTED INVALID a month ago

I was never able to reproduce + stale issue.

Register here or Log in to comment, or comment via email.