tpope / vim-rails

rails.vim: Ruby on Rails power tools
http://www.vim.org/scripts/script.php?script_id=1567
4.09k stars 381 forks source link

*.turbo_stream.erb file support #601

Open thewatts opened 7 months ago

thewatts commented 7 months ago

Hi There!

Just started leveraging this plugin, and it's amazing (👏). Thank you for all your hard work on this!

Something I noticed, is that with the new Rails view format for turbostreams, ex: new.turbo_stream.erb, vim is setting the filetype to eruby.html, instead of eruby.

As such - my linter is throwing errors.

Here's an example below - top with vim-rails enabled, bottom with it disabled:

CleanShot 2023-12-09 at 12 58 09@2x

Note: This doesn't happen with the typical new.html.erb type files - it is only happening with turbo_stream files.

Any help here would be greatly appreciated.

Thank you!

thewatts commented 7 months ago

It looks like something was added already here: https://github.com/tpope/vim-rails/commit/855ff28e6c0aacc5e1fdfbf965283bd80cb0d89d

However, I don't know the difference between eruby and eruby.html filetypes.

@kulbirsaini - I see that you added the initial issue, here: https://github.com/tpope/vim-rails/issues/587 -

Is eruby.html some sort of filetype that you have configured through a plugin that isn't the typical eruby?

kulbirsaini commented 6 months ago

@thewatts sorry, just seeing this. eruby.html is added by this plugin itself at https://github.com/tpope/vim-rails/blob/master/plugin/rails.vim#L117-L118 . I have not added any custom filetype to my .vimrc.

Edit: Just realized that line comes from my suggestion. Only other ruby/rails plugin I use is https://github.com/vim-ruby/vim-ruby. So, I guess it has something to do with that plugin.