]> granicus.if.org Git - vim/commitdiff
patch 9.0.1268: .clangd and .stylelintrc files don't get a filetype v9.0.1268
authorMark Skelton <mdskelton99@gmail.com>
Tue, 31 Jan 2023 18:57:17 +0000 (18:57 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 31 Jan 2023 18:57:17 +0000 (18:57 +0000)
Problem:    .clangd and .stylelintrc files don't get a filetype.
Solution:   Use yaml for .clangd and json for .stylelintrc files. (Mark
            Skelton, closes #11916)

runtime/filetype.vim
src/testdir/test_filetype.vim
src/version.c

index 200153e75e7e645702e2baeeea84c01022c8d8d6..a06b450d0afdfad509886dc1712199ed555c6a6c 100644 (file)
@@ -371,6 +371,9 @@ au BufNewFile,BufRead *.ch                  call dist#ft#FTchange()
 " ChordPro
 au BufNewFile,BufRead *.chopro,*.crd,*.cho,*.crdpro,*.chordpro setf chordpro
 
+" Clangd
+au BufNewFile,BufRead .clangd                  setf yaml
+
 " Clang-format
 au BufNewFile,BufRead .clang-format            setf yaml
 
@@ -1017,7 +1020,7 @@ au BufNewFile,BufRead *.json-patch                setf json
 au BufNewFile,BufRead *.ipynb                  setf json
 
 " Other files that look like json
-au BufNewFile,BufRead .prettierrc,.firebaserc  setf json
+au BufNewFile,BufRead .prettierrc,.firebaserc,.stylelintrc     setf json
 
 " JSONC (JSON with comments)
 au BufNewFile,BufRead *.jsonc,.babelrc,.eslintrc,.jsfmtrc      setf jsonc
index 790d98c550349b768ca6b3de18767680d3b15b8e..6ffb46755bb8aa3537f4be8a3b1aaf486b45ccfb 100644 (file)
@@ -293,7 +293,7 @@ let s:filename_checks = {
     \ 'jq': ['file.jq'],
     \ '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'],
-    \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.prettierrc', '.firebaserc', 'file.slnf'],
+    \ 'json': ['file.json', 'file.jsonp', 'file.json-patch', 'file.webmanifest', 'Pipfile.lock', 'file.ipynb', '.prettierrc', '.firebaserc', '.stylelintrc', 'file.slnf'],
     \ 'json5': ['file.json5'],
     \ 'jsonc': ['file.jsonc', '.babelrc', '.eslintrc', '.jsfmtrc', '.jshintc', '.hintrc', '.swrc', 'jsconfig.json', 'tsconfig.json', 'tsconfig.test.json', 'tsconfig-test.json'],
     \ 'jsonnet': ['file.jsonnet', 'file.libsonnet'],
@@ -656,7 +656,7 @@ let s:filename_checks = {
     \ 'xsd': ['file.xsd'],
     \ 'xslt': ['file.xsl', 'file.xslt'],
     \ 'yacc': ['file.yy', 'file.yxx', 'file.y++'],
-    \ 'yaml': ['file.yaml', 'file.yml', '.clang-format', '.clang-tidy'],
+    \ 'yaml': ['file.yaml', 'file.yml', '.clangd', '.clang-format', '.clang-tidy'],
     \ 'yang': ['file.yang'],
     \ 'z8a': ['file.z8a'],
     \ 'zig': ['file.zig'],
index e06b6be03b2cebcbf380241c6efca76eb0211e44..45dd798bf512feb561248fa92deae08ee1a19e82 100644 (file)
@@ -695,6 +695,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1268,
 /**/
     1267,
 /**/