stsewd / tree-sitter-comment

Tree-sitter grammar for comment tags like TODO, FIXME(user).

Home Page:https://stsewd.dev/tree-sitter-comment/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Major performance issues with this parser enabled while editing Lua code

no-more-secrets opened this issue · comments

Hi there, I just had to disable this plugin as it is creating major performance issues in my editor at least when editing certain file types. Here is my setup:

OS: Linux; confirmed to happen on both Pop!_OS 20.04 and RedHat8, so probably not distro-dependent.
Editor: Neovim v0.9.1
tree-sitter-comment version: latest

It only seems to happen though when editing Lua files. In my treesitter neovim config file I have parsers for many languages enabled, including "lua" and "comment". When I enable "comment" it makes my editor slow to a crawl, to the point where I can hardly scroll the cursor around. And it seems to get worse the longer the editing session. When I uninstall only the "comment" parser, then everything is fine.

Any idea? Sorry I can't give a reproducer, but just wanted to bring this to your attention.

Hi, are you still able to reproduce this? There have been several improvements in Neovim to better handle injections. There is also the possibility that the parser got slow with the introduction of URLs, haven't done any tests related to that, so it's just a possibility.

@stsewd Actually for the last couple of months tree-sitter-comment doesn't seem to work for me any longer at all (i.e. my TODOs and NOTEs are no longer highlighted). I don't think I changed anything config-wise, I think it was just after an update of some kind, either nvim or plugins. Has anything recently changed with the plugin that would require a different/new configuration?

I'm using the latest versions of both, everything works for me. Make sure you have the parser installed :TSInstall comment.

Yes I have it installed and enabled (I also tried uninstalling/reinstalling). I'm going to try doing a more thorough investigation to see if the issue is some other aspect of my config that is interfering, and come back at some point.

Would you expect tree-sitter-comment to be interfered with in any way by enabling LSP syntax highlighting? I suppose that's not the issue since I tried disabling that to no avail, but am just curious if anything LSP-related could interfere.

Would you expect tree-sitter-comment to be interfered with in any way by enabling LSP syntax highlighting? I suppose that's not the issue since I tried disabling that to no avail, but am just curious if anything LSP-related could interfere.

I know there is a problem with one Lua's LSP that overrides highlight for comments, see #22.