sheerun / vim-polyglot

A solid language pack for Vim.
5.6k stars 296 forks source link

Collision: `*.comp` extension is registered for both mason and glsl filetypes #841

Open w23 opened 1 year ago

w23 commented 1 year ago

mason: https://github.com/sheerun/vim-polyglot/blob/bc8a81d3592dab86334f27d1d43c080ebf680d42/autoload/polyglot/init.vim#L2221

glsl: https://github.com/sheerun/vim-polyglot/blob/bc8a81d3592dab86334f27d1d43c080ebf680d42/autoload/polyglot/init.vim#L2350

I edit *.comp files as GLSL compute shaders, and was rather surprised when they were not highlighted properly due to having mason filetype.

The workaround is to add perl into polyglot_disable global variable, as mason registration happens under "perl is not disabled" condition.

But I wonder what is a proper way to fix it.

  1. Is *.comp even a valid/common file extension for mason, whatever that is?
  2. More collisions can be expected (e.g. https://github.com/sheerun/vim-polyglot/issues/670). Is there a reasonable way to disambiguate those without disabling support for whole languages?