diff options
author | zeertzjq <zeertzjq@outlook.com> | 2025-01-14 18:55:06 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2025-01-14 18:55:06 +0800 |
commit | 69ad6b12ec473a54f09a11596da724178185eb7a (patch) | |
tree | a37137b7107cda6552d0acac73f362c739a727cc | |
parent | c5f93d7ab04f93db1470d58ca1f70e947e716c2b (diff) | |
download | rneovim-69ad6b12ec473a54f09a11596da724178185eb7a.tar.gz rneovim-69ad6b12ec473a54f09a11596da724178185eb7a.tar.bz2 rneovim-69ad6b12ec473a54f09a11596da724178185eb7a.zip |
vim-patch:9.1.1010: filetype: VisualCode setting file not recognized (#32003)
Problem: filetype: VisualCode setting file not recognized
Solution: detect json files in VSCode config directory as jsonc filetype
(Konfekt)
closes: vim/vim#16400
https://github.com/vim/vim/commit/c200f53cbb03fa11e489a27791d5b9dfc34a6564
Co-authored-by: Konfekt <Konfekt@users.noreply.github.com>
-rw-r--r-- | runtime/lua/vim/filetype.lua | 2 | ||||
-rw-r--r-- | test/old/testdir/test_filetype.vim | 2 |
2 files changed, 3 insertions, 1 deletions
diff --git a/runtime/lua/vim/filetype.lua b/runtime/lua/vim/filetype.lua index bc866db399..1960bca52b 100644 --- a/runtime/lua/vim/filetype.lua +++ b/runtime/lua/vim/filetype.lua @@ -2374,6 +2374,8 @@ local pattern = { ['%.html%.m4$'] = 'htmlm4', ['^JAM.*%.'] = starsetf('jam'), ['^Prl.*%.'] = starsetf('jam'), + ['^${HOME}/.*/Code/User/.*%.json$'] = 'jsonc', + ['^${HOME}/.*/VSCodium/User/.*%.json$'] = 'jsonc', ['%.properties_..$'] = 'jproperties', ['%.properties_.._..$'] = 'jproperties', ['%.properties_.._.._'] = starsetf('jproperties'), diff --git a/test/old/testdir/test_filetype.vim b/test/old/testdir/test_filetype.vim index 5182ff5167..2c6b1bd0f4 100644 --- a/test/old/testdir/test_filetype.vim +++ b/test/old/testdir/test_filetype.vim @@ -395,7 +395,7 @@ func s:GetFilenameChecks() abort \ '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'], \ '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'], + \ '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")], \ 'jsonl': ['file.jsonl'], \ 'jsonnet': ['file.jsonnet', 'file.libsonnet'], \ 'jsp': ['file.jsp'], |