nvim-treesitter / nvim-treesitter-angular

Neovim treesitter integration with Angular
Apache License 2.0
22 stars 12 forks source link

localize function significantly degrades performance #1

Closed Everduin94 closed 1 year ago

Everduin94 commented 2 years ago

Issue

When using nvim-treesitter-angular and highlight enabled for typescript. If a localize function is added to the file, the performance degrades to a point that it is unusable.

Example

https://user-images.githubusercontent.com/14320878/137019217-26a49f25-9ca4-4e97-a9ac-eef3a1892c96.mov

My config

Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}
Plug 'nvim-treesitter/nvim-treesitter-angular'

lua << EOF
require'nvim-treesitter.configs'.setup {
  ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages
  ignore_install = { "haskell" }, -- List of parsers to ignore installing
  highlight = {
    enable = true,              -- false will disable the whole extension
  },
}
EOF

NVIM v0.6.0-dev+446-g0fc8597f0

steelsojka commented 2 years ago

I don't think this specific to angular, but treesitter integration in general. The current queries for typescript use language injection for template tags, so that may be impacting it.

On Tue, Oct 12, 2021, 2:46 PM Erik @.***> wrote:

Issue

When using nvim-treesitter-angular and highlight enabled for typescript. If a localize function is added to the file, the performance degrades to a point that it is unusable. Example

https://user-images.githubusercontent.com/14320878/137019217-26a49f25-9ca4-4e97-a9ac-eef3a1892c96.mov My config

Plug 'nvim-treesitter/nvim-treesitter', {'do': ':TSUpdate'}Plug 'nvim-treesitter/nvim-treesitter-angular'

lua << EOFrequire'nvim-treesitter.configs'.setup { ensure_installed = "all", -- one of "all", "maintained" (parsers with maintainers), or a list of languages ignore_install = { "haskell" }, -- List of parsers to ignore installing highlight = { enable = true, -- false will disable the whole extension }, } EOF

NVIM v0.6.0-dev+446-g0fc8597f0

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/nvim-treesitter/nvim-treesitter-angular/issues/1, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAPXOSSNOFEVGUAUEGFDJULUGSGCPANCNFSM5F3NDPSA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.

Everduin94 commented 2 years ago

Yeah I'm not sure what specifically causes the performance degrading (I'm relatively new to nvim and treesitter 😬), but I posted the issue here because if I remove nvim-treesitter-angular plugin but keep nvim-treesitter + highlighting for typescript; I don't have the same performance issues.

Example

https://user-images.githubusercontent.com/14320878/137026664-75fb97c1-9556-4a88-a38b-c0f9d78b406d.mov