From a18d51a9580e4f60c47766bfd8bbded4b465dd73 Mon Sep 17 00:00:00 2001 From: zeertzjq Date: Fri, 20 Mar 2026 07:38:26 +0800 Subject: [PATCH] vim-patch:9.2.0204: filetype: cps files are not recognized Problem: filetype: cps files are not recognized Solution: Detect *.cps files as json filetype (Guillaume Barbier). Reference: https://github.com/cps-org/cps https://cps-org.github.io/cps/ closes: vim/vim#19758 https://github.com/vim/vim/commit/53884ba7a8fb22de006689a6feb88fb8f0bd7db9 Co-authored-by: Guillaume Barbier --- runtime/lua/vim/filetype.lua | 1 + test/old/testdir/test_filetype.vim | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index fd8b905175..e954ef036c 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -679,6 +679,7 @@ local extension = { bd = 'json', bda = 'json', xci = 'json', + cps = 'json', json5 = 'json5', jsonc = 'jsonc', jsonl = 'jsonl', diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 5577337391..3dbc3b55fd 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -418,7 +418,9 @@ func s:GetFilenameChecks() abort \ 'jovial': ['file.jov', 'file.j73', 'file.jovial'], \ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'], \ 'jq': ['file.jq'], - \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock', '.swcrc', 'composer.lock', 'symfony.lock'], + \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', 'file.cps', + \ '.prettierrc', '.firebaserc', '.stylelintrc', '.lintstagedrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', + \ 'file.bd', 'file.bda', 'file.xci', 'flake.lock', 'pack.mcmeta', 'deno.lock', '.swcrc', 'composer.lock', 'symfony.lock'], \ 'json5': ['file.json5'], \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc', 'bun.lock', expand("$HOME/.config/VSCodium/User/settings.json"), '/home/user/.config/waybar/config'], \ 'jsonl': ['file.jsonl'],