Skip to content

Commit efc3be7

Browse files
botantonychrisbra
authored andcommitted
patch 9.1.1906: filetype: not all Ruby files are recognized
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: #18697 Signed-off-by: botantony <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 1ff3e70 commit efc3be7

3 files changed

Lines changed: 10 additions & 2 deletions

File tree

runtime/autoload/dist/ft.vim

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ vim9script
33
# Vim functions for file type detection
44
#
55
# Maintainer: The Vim Project <https://github.com/vim/vim>
6-
# Last Change: 2025 Oct 31
6+
# Last Change: 2025 Nov 11
77
# Former Maintainer: Bram Moolenaar <[email protected]>
88

99
# These functions are moved here from runtime/filetype.vim to make startup
@@ -2571,6 +2571,8 @@ const ft_from_ext = {
25712571
"builder": "ruby",
25722572
"rxml": "ruby",
25732573
"rjs": "ruby",
2574+
# Sorbet (Ruby typechecker)
2575+
"rbi": "ruby",
25742576
# Rust
25752577
"rs": "rust",
25762578
# S-lang
@@ -2999,6 +3001,8 @@ const ft_from_name = {
29993001
"apt.conf": "aptconf",
30003002
# BIND zone
30013003
"named.root": "bindzone",
3004+
# Brewfile (uses Ruby syntax)
3005+
"Brewfile": "ruby",
30023006
# Busted (Lua unit testing framework - configuration files)
30033007
".busted": "lua",
30043008
# Bun history

src/testdir/test_filetype.vim

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -695,7 +695,9 @@ def s:GetFilenameChecks(): dict<list<string>>
695695
rrst: ['file.rrst', 'file.srst'],
696696
rst: ['file.rst'],
697697
rtf: ['file.rtf'],
698-
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'],
698+
ruby: ['.irbrc', 'irbrc', '.irb_history', 'irb_history', 'file.rb', 'file.rbi', 'file.rbw', 'file.gemspec', 'file.ru', 'Gemfile', 'file.builder',
699+
'file.rxml', 'file.rjs', 'file.rant', 'file.rake', 'rakefile', 'Rakefile', 'rantfile', 'Rantfile', 'rakefile-file', 'Rakefile-file',
700+
'Puppetfile', 'Vagrantfile', 'Brewfile'],
699701
rust: ['file.rs'],
700702
sage: ['file.sage'],
701703
salt: ['file.sls'],

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -729,6 +729,8 @@ static char *(features[]) =
729729

730730
static int included_patches[] =
731731
{ /* Add new patch number below this line */
732+
/**/
733+
1906,
732734
/**/
733735
1905,
734736
/**/

0 commit comments

Comments
 (0)