Skip to content

Commit 4e722fd

Browse files
scottmckendrychrisbra
authored andcommitted
patch 9.1.2027: filetype: bicep filetype used for 2 bicep file types
Problem: filetype: bicep filetype used for 2 bicep file types Solution: Detect *.bicepparam files as bicep-param filetype, include new bicep-params and bicep filetype plugin (Scott McKendry) The bicep language server handles parameter files differently than regular bicep files. Treating them the same at the editor level leads to false positive diagnostics in the editor. References: Bicep Language Constants: - https://github.com/Azure/bicep/blob/51392d32ca2c8b94b1bb7a255e78e1d559d12573/src/Bicep.Core/LanguageConstants.cs#L23 VS Code Extension definition: - https://github.com/Azure/bicep/blob/51392d32ca2c8b94b1bb7a255e78e1d559d12573/src/vscode-bicep/package.json#L47 closes: #19026 Signed-off-by: Scott McKendry <[email protected]> Signed-off-by: Christian Brabandt <[email protected]>
1 parent 78046cc commit 4e722fd

6 files changed

Lines changed: 25 additions & 3 deletions

File tree

.github/MAINTAINERS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,8 @@ runtime/ftplugin/asy.vim @avidseeker
127127
runtime/ftplugin/autohotkey.vim @telemachus
128128
runtime/ftplugin/awk.vim @dkearns
129129
runtime/ftplugin/basic.vim @dkearns
130+
runtime/ftplugin/bicep.vim @scottmckendry
131+
runtime/ftplugin/bicep-params.vim @scottmckendry
130132
runtime/ftplugin/brighterscript.vim @ribru17
131133
runtime/ftplugin/brightscript.vim @ribru17
132134
runtime/ftplugin/bst.vim @tpope

runtime/autoload/dist/ft.vim

Lines changed: 2 additions & 2 deletions
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 Dec 26
6+
# Last Change: 2025 Dec 27
77
# Former Maintainer: Bram Moolenaar <[email protected]>
88

99
# These functions are moved here from runtime/filetype.vim to make startup
@@ -1746,7 +1746,7 @@ const ft_from_ext = {
17461746
"bst": "bst",
17471747
# Bicep
17481748
"bicep": "bicep",
1749-
"bicepparam": "bicep",
1749+
"bicepparam": "bicep-params",
17501750
# BIND zone
17511751
"zone": "bindzone",
17521752
# Blank

runtime/ftplugin/bicep-params.vim

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
" Placeholder for maximum compatibility. While bicepparam files are treated as distinct filetypes,
2+
" they are should share the same ftplugin settings as bicep files.
3+
runtime! ftplugin/bicep.vim

runtime/ftplugin/bicep.vim

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
" Vim filetype plugin
2+
" Language: Bicep
3+
" Maintainer: Scott McKendry <[email protected]>
4+
" Last Change: 2025 Dec 27
5+
6+
if exists('b:did_ftplugin')
7+
finish
8+
endif
9+
let b:did_ftplugin = 1
10+
11+
setlocal comments=s1:/*,mb:*,ex:*/,://
12+
setlocal commentstring=//\ %s
13+
14+
let b:undo_ftplugin = "setlocal comments< commentstring<"

src/testdir/test_filetype.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,8 @@ def s:GetFilenameChecks(): dict<list<string>>
140140
bdf: ['file.bdf'],
141141
beancount: ['file.beancount'],
142142
bib: ['file.bib'],
143-
bicep: ['file.bicep', 'file.bicepparam'],
143+
bicep: ['file.bicep'],
144+
bicep-params: ['file.bicepparam'],
144145
bindzone: ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file', 'foobar.zone'],
145146
bitbake: ['file.bb', 'file.bbappend', 'file.bbclass', 'build/conf/local.conf', 'meta/conf/layer.conf', 'build/conf/bbappend.conf', 'meta-layer/conf/distro/foo.conf',
146147
'project-spec/configs/zynqmp-generic-xczu7ev.conf'],

src/version.c

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

735735
static int included_patches[] =
736736
{ /* Add new patch number below this line */
737+
/**/
738+
2027,
737739
/**/
738740
2026,
739741
/**/

0 commit comments

Comments
 (0)