Skip to content

Commit

Permalink
Add WebGPU Shading Language (WGSL) filetype (#12723)
Browse files Browse the repository at this point in the history
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:
neovim/neovim#23331

This commit adds this missing wgsl filetype.
  • Loading branch information
gergo-salyi committed Aug 9, 2023
1 parent 8f566fd commit a13eb2b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
3 changes: 3 additions & 0 deletions runtime/filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
1 change: 1 addition & 0 deletions src/testdir/test_filetype.vim
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
Expand Down

0 comments on commit a13eb2b

Please sign in to comment.