aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorzeertzjq <zeertzjq@outlook.com>2024-04-16 08:22:51 +0800
committerzeertzjq <zeertzjq@outlook.com>2024-04-16 08:32:08 +0800
commitca2f24cbbd52f1f6b73d0e5fc19b11bade606e45 (patch)
tree96e9b0fadb0e7578795d69acd2202fa348ac92ae
parentfcf17c88590b4fb471821d69b1e30796129bebc1 (diff)
downloadrneovim-ca2f24cbbd52f1f6b73d0e5fc19b11bade606e45.tar.gz
rneovim-ca2f24cbbd52f1f6b73d0e5fc19b11bade606e45.tar.bz2
rneovim-ca2f24cbbd52f1f6b73d0e5fc19b11bade606e45.zip
vim-patch:9.1.0324: filetype: some json files are not recognized
Problem: filetype: some json files are not recognized Solution: Detect '.jscsrc' and '.vsconfig' as jsonc filetype (Wu, Zhenyu) See: - https://github.com/microsoft/PowerToys/blob/main/.vsconfig - https://jscs-dev.github.io/ closes: vim/vim#14452 https://github.com/vim/vim/commit/c59a8648b2d8b3e17f12cd45f74a31b1aa385d2d Co-authored-by: Wu, Zhenyu <wuzhenyu@ustc.edu>
-rw-r--r--runtime/lua/vim/filetype.lua2
-rw-r--r--test/old/testdir/test_filetype.vim2
2 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua
index d622566d55..8b800cf859 100644
--- a/runtime/lua/vim/filetype.lua
+++ b/runtime/lua/vim/filetype.lua
@@ -1437,10 +1437,12 @@ local filename = {
['.babelrc'] = 'jsonc',
['.eslintrc'] = 'jsonc',
['.hintrc'] = 'jsonc',
+ ['.jscsrc'] = 'jsonc',
['.jsfmtrc'] = 'jsonc',
['.jshintrc'] = 'jsonc',
['.luaurc'] = 'jsonc',
['.swrc'] = 'jsonc',
+ ['.vsconfig'] = 'jsonc',
['.justfile'] = 'just',
Kconfig = 'kconfig',
['Kconfig.debug'] = 'kconfig',
diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim
index e0962966bb..e2fae52e1e 100644
--- a/test/old/testdir/test_filetype.vim
+++ b/test/old/testdir/test_filetype.vim
@@ -363,7 +363,7 @@ func s:GetFilenameChecks() abort
\ 'jproperties': ['file.properties', 'file.properties_xx', 'file.properties_xx_xx', 'some.properties_xx_xx_file', 'org.eclipse.xyz.prefs'],
\ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.geojson', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', 'file.jupyterlab-settings', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf', 'file.sublime-project', 'file.sublime-settings', 'file.sublime-workspace', 'file.bd', 'file.bda', 'file.xci'],
\ 'json5': ['file.json5'],
- \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc'],
+ \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintrc', '.jscsrc', '.vsconfig', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json', '.luaurc'],
\ 'jsonl': ['file.jsonl'],
\ 'jsonnet': ['file.jsonnet', 'file.libsonnet'],
\ 'jsp': ['file.jsp'],