I am noticing a significant delay in the UI when opening a large file during syntax highlighting. Currently the UI is frozen until we’ve finished.
My example is GitHawk’s API file gql/API.swift
I’d be interested to see what could be done to allow for the task to be cancellable or in the background — to allow for the user to continue to use the other tabs / the rest of the app instead of locking the main thread?
Any idea if this is the syntax highlighting or the size of the file itself?
That's a good question. I've experimented with removing the highlighting and simply loading the gql/API.swift file as vanilla text and it seems to come up quickly. That's why I'm pointing a finger at the highlighter.
Should only take a quick Time Profile to figure out what the culprit is.
Yup its Highlightr and its running on the main thread. Might be able to just move this to a bg queue and call it a day.

Most helpful comment
Yup its Highlightr and its running on the main thread. Might be able to just move this to a bg queue and call it a day.