neovim

Neovim text editor
git clone https://git.dasho.dev/neovim.git
Log | Files | Refs | README

commit 7f1d7271d5d3cf3af8075766e834f171e488aef6
parent 1e44a001ecdbfcd7155b3b18adaece3c3c816e36
Author: zeertzjq <zeertzjq@outlook.com>
Date:   Sun, 28 Dec 2025 08:16:20 +0800

vim-patch:9.1.2027: filetype: bicep filetype used for 2 bicep file types (#37130)

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: vim/vim#19026

https://github.com/vim/vim/commit/4e722fdfdd987c11136e3533bd65d0ed4d15f829

Co-authored-by: Scott McKendry <me@scottmckendry.tech>
Diffstat:
Aruntime/ftplugin/bicep-params.vim | 3+++
Aruntime/ftplugin/bicep.vim | 14++++++++++++++
Mruntime/lua/vim/filetype.lua | 2+-
Mtest/old/testdir/test_filetype.vim | 3++-
4 files changed, 20 insertions(+), 2 deletions(-)

diff --git a/runtime/ftplugin/bicep-params.vim b/runtime/ftplugin/bicep-params.vim @@ -0,0 +1,3 @@ +" Placeholder for maximum compatibility. While bicepparam files are treated as distinct filetypes, +" they are should share the same ftplugin settings as bicep files. +runtime! ftplugin/bicep.vim diff --git a/runtime/ftplugin/bicep.vim b/runtime/ftplugin/bicep.vim @@ -0,0 +1,14 @@ +" Vim filetype plugin +" Language: Bicep +" Maintainer: Scott McKendry <me@scottmckendry.tech> +" Last Change: 2025 Dec 27 + +if exists('b:did_ftplugin') + finish +endif +let b:did_ftplugin = 1 + +setlocal comments=s1:/*,mb:*,ex:*/,:// +setlocal commentstring=//\ %s + +let b:undo_ftplugin = "setlocal comments< commentstring<" diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua @@ -260,7 +260,7 @@ local extension = { com = detect_seq(detect.bindzone, 'dcl'), db = detect.bindzone, bicep = 'bicep', - bicepparam = 'bicep', + bicepparam = 'bicep-params', zone = 'bindzone', bb = 'bitbake', bbappend = 'bitbake', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim @@ -141,7 +141,8 @@ func s:GetFilenameChecks() abort \ 'bdf': ['file.bdf'], \ 'beancount': ['file.beancount'], \ 'bib': ['file.bib'], - \ 'bicep': ['file.bicep', 'file.bicepparam'], + \ 'bicep': ['file.bicep'], + \ 'bicep-params': ['file.bicepparam'], \ 'bindzone': ['named.root', '/bind/db.file', '/named/db.file', 'any/bind/db.file', 'any/named/db.file', 'foobar.zone'], \ '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', 'project-spec/configs/zynqmp-generic-xczu7ev.conf'], \ 'blade': ['file.blade.php'],