mirror of
https://github.com/dense-analysis/ale.git
synced 2026-01-25 20:36:51 +08:00
Add naga linter for WGSL support (#4047)
* Add WGSL support using `naga` command * Add documents for wgsl * Add test for `naga` linter * Separate naga handler callback to hanlder/naga.vim
This commit is contained in:
23
test/handler/test_naga_handler.vader
Normal file
23
test/handler/test_naga_handler.vader
Normal file
@@ -0,0 +1,23 @@
|
||||
Before:
|
||||
runtime ale_linters/wgsl/naga.vim
|
||||
|
||||
After:
|
||||
call ale#linter#Reset()
|
||||
|
||||
Execute(Error handler should parse error message and position from input):
|
||||
let example_output = [
|
||||
\ "error: expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file, found '['",
|
||||
\ " ┌─ wgsl:5:1",
|
||||
\ " │",
|
||||
\ "5 │ [[group(1), binding(0)]]",
|
||||
\ " │ ^ expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file",
|
||||
\ "Could not parse WGSL",
|
||||
\ ]
|
||||
let actual = ale#handlers#naga#Handle(0, example_output)
|
||||
let expected = [{
|
||||
\ "text": "expected global item ('struct', 'let', 'var', 'type', ';', 'fn') or the end of the file, found '['",
|
||||
\ "lnum": 5,
|
||||
\ "col": 1,
|
||||
\ "type": "E",
|
||||
\ }]
|
||||
AssertEqual actual, expected
|
||||
Reference in New Issue
Block a user