patch 9.1.1906: filetype: not all Ruby files are recognized
Commit:
https://github.com/vim/vim/commit/efc3be77bbf707edad9cbbda7aef471de65411fd
Author: botantony <[email protected]>
Date: Tue Nov 11 17:26:02 2025 +0000
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]>
diff --git a/runtime/autoload/dist/ft.vim b/runtime/autoload/dist/ft.vim
index 88e81099e..2ab128a21 100644
--- a/runtime/autoload/dist/ft.vim
+++ b/runtime/autoload/dist/ft.vim
@@ -3,7 +3,7 @@ vim9script
# Vim functions for file type detection
#
# Maintainer: The Vim Project <https://github.com/vim/vim>
-# Last Change: 2025 Oct 31
+# Last Change: 2025 Nov 11
# Former Maintainer: Bram Moolenaar <[email protected]>
# These functions are moved here from runtime/filetype.vim to make startup
@@ -2571,6 +2571,8 @@ const ft_from_ext = {
"builder": "ruby",
"rxml": "ruby",
"rjs": "ruby",
+ # Sorbet (Ruby typechecker)
+ "rbi": "ruby",
# Rust
"rs": "rust",
# S-lang
@@ -2999,6 +3001,8 @@ const ft_from_name = {
"apt.conf": "aptconf",
# BIND zone
"named.root": "bindzone",
+ # Brewfile (uses Ruby syntax)
+ "Brewfile": "ruby",
# Busted (Lua unit testing framework - configuration files)
".busted": "lua",
# Bun history
diff --git a/src/testdir/test_filetype.vim b/src/testdir/test_filetype.vim
index 31aa2b2d5..c2a8485c1 100644
--- a/src/testdir/test_filetype.vim
+++ b/src/testdir/test_filetype.vim
@@ -695,7 +695,9 @@ def s:GetFilenameChecks(): dict<list<string>>
rrst: ['file.rrst', 'file.srst'],
rst: ['file.rst'],
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'],
sage: ['file.sage'],
salt: ['file.sls'],
diff --git a/src/version.c b/src/version.c
index 177780a74..acb1c5d7c 100644
--- a/src/version.c
+++ b/src/version.c
@@ -729,6 +729,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
+/**/
+ 1906,
/**/
1905,
/**/
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion visit
https://groups.google.com/d/msgid/vim_dev/E1vJWPK-001DLv-K3%40256bit.org.