]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
Add WebGPU Shading Language (WGSL) filetype (#12723)
authorGergő Sályi <87373293+gergo-salyi@users.noreply.github.com>
Wed, 9 Aug 2023 14:49:01 +0000 (16:49 +0200)
committerGitHub <noreply@github.com>
Wed, 9 Aug 2023 14:49:01 +0000 (16:49 +0200)
The current W3C Working Draft for the WebGPU Shading Language (WGSL) specifies
'text/wgsl' media type for WGSL modules with the '.wgsl' file extension:
https://www.w3.org/TR/WGSL/#text-wgsl-media-type

It has also been registered at the Internet Assigned Numbers Authority (IANA):
https://www.iana.org/assignments/media-types/text/wgsl

Neovim's nvim-lspconfig already associates wgsl language servers
with 'filetype wgsl':
https://github.com/neovim/nvim-lspconfig/blob/master/doc/server_configurations.md#wgsl_analyzer

However currenly setting 'filetype wgsl' for *.wgsl files by defalut in Neovim
is blocked by adding this filetype to the vim project first:
https://github.com/neovim/neovim/pull/23331

This commit adds this missing wgsl filetype.

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

index d0ee535f587d2534451ba6c273c90111bfdf28f9..f63a1461a1bf99bc7782294d4b97f79551cfe055 100644 (file)
@@ -2399,6 +2399,9 @@ au BufNewFile,BufRead .wgetrc,wgetrc              setf wget
 " Wget2 config
 au BufNewFile,BufRead .wget2rc,wget2rc         setf wget2
 
+" WebGPU Shading Language (WGSL)
+au BufNewFile,BufRead *.wgsl                   setf wgsl
+
 " Website MetaLanguage
 au BufNewFile,BufRead *.wml                    setf wml
 
index 778e840d0e3ae46a6d10759f1f307a0cde59a5e1..1540f92fd8a78e9158b85d1fa8b7b6566ad56dcd 100644 (file)
@@ -775,6 +775,7 @@ def s:GetFilenameChecks(): dict<list<string>>
     webmacro: ['file.wm'],
     wget: ['.wgetrc', 'wgetrc'],
     wget2: ['.wget2rc', 'wget2rc'],
+    wgsl: ['file.wgsl'],
     winbatch: ['file.wbt'],
     wit: ['file.wit'],
     wml: ['file.wml'],