vim-patch:9.1.1906: filetype: not all Ruby files are recognized (#36526)

Problem:  filetype: not all Ruby files are recognized
Solution: Detect *.rbi and Brewfile as ruby filetype
          (botantony).

- `rbi` is a file extension used by Sorbet, typechecker for Ruby:
   https://sorbet.org/docs/rbi

- `Brewfile` is a bundler file for Homebrew package manager:
   https://docs.brew.sh/Brew-Bundle-and-Brewfile

closes: vim/vim#18697

efc3be77bb

Co-authored-by: botantony <antonsm21@gmail.com>
This commit is contained in:
zeertzjq
2025-11-12 07:38:55 +08:00
committed by GitHub
parent 2822c38f2e
commit 97cb0d5571
2 changed files with 5 additions and 1 deletions

View File

@@ -1099,6 +1099,7 @@ local extension = {
rjs = 'ruby', rjs = 'ruby',
rxml = 'ruby', rxml = 'ruby',
rb = 'ruby', rb = 'ruby',
rbi = 'ruby',
rant = 'ruby', rant = 'ruby',
ru = 'ruby', ru = 'ruby',
rbw = 'ruby', rbw = 'ruby',
@@ -1844,6 +1845,7 @@ local filename = {
['requirements.in'] = 'requirements', ['requirements.in'] = 'requirements',
['resolv.conf'] = 'resolv', ['resolv.conf'] = 'resolv',
['robots.txt'] = 'robots', ['robots.txt'] = 'robots',
Brewfile = 'ruby',
Gemfile = 'ruby', Gemfile = 'ruby',
Puppetfile = 'ruby', Puppetfile = 'ruby',
['.irbrc'] = 'ruby', ['.irbrc'] = 'ruby',

View File

@@ -692,7 +692,9 @@ func s:GetFilenameChecks() abort
\ 'rrst': ['file.rrst', 'file.srst'], \ 'rrst': ['file.rrst', 'file.srst'],
\ 'rst': ['file.rst'], \ 'rst': ['file.rst'],
\ 'rtf': ['file.rtf'], \ 'rtf': ['file.rtf'],
\ 'ruby': ['.irbrc', 'irbrc', '.irb_history', 'irb_history', 'file.rb', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder', 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file', 'Puppetfile', 'Vagrantfile'], \ 'ruby': ['.irbrc', 'irbrc', '.irb_history', 'irb_history', 'file.rb', 'file.rbi', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder',
\ 'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file',
\ 'Puppetfile', 'Vagrantfile', 'Brewfile'],
\ 'rust': ['file.rs'], \ 'rust': ['file.rs'],
\ 'sage': ['file.sage'], \ 'sage': ['file.sage'],
\ 'salt': ['file.sls'], \ 'salt': ['file.sls'],