Skip to content

Commit 78b05d3

Browse files
bouncemew0rp
authored andcommitted
escape dot in maker regex (#357)
* escape dot in maker regex * Create test_typecheck_handler * Rename test_typecheck_handler to test_typecheck_handler.vader
1 parent 6f6c156 commit 78b05d3

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

ale_linters/typescript/typecheck.vim

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ function! ale_linters#typescript#typecheck#Handle(buffer, lines) abort
77
" hello.ts[7, 41]: Property 'a' does not exist on type 'A'
88
" hello.ts[16, 7]: Type 'A' is not assignable to type 'B'
99
"
10-
let l:pattern = '.\+.ts\[\(\d\+\), \(\d\+\)\]: \(.\+\)'
10+
let l:pattern = '.\+\.ts\[\(\d\+\), \(\d\+\)\]: \(.\+\)'
1111
let l:output = []
1212

1313
for l:line in a:lines

test/test_typecheck_handler.vader

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
Execute(The typecheck handler should parse lines correctly):
2+
runtime ale_linters/typescript/typecheck.vim
3+
4+
AssertEqual
5+
\ [
6+
\ {
7+
\ 'bufnr': 347,
8+
\ 'lnum': 16,
9+
\ 'vcol': 0,
10+
\ 'col': 7,
11+
\ 'text': "Type 'A' is not assignable to type 'B'",
12+
\ 'type': 'E',
13+
\ 'nr': -1,
14+
\ },
15+
\ {
16+
\ 'bufnr': 347,
17+
\ 'lnum': 7,
18+
\ 'vcol': 0,
19+
\ 'col': 41,
20+
\ 'text': "Property 'a' does not exist on type 'A'",
21+
\ 'type': 'E',
22+
\ 'nr': -1,
23+
\ },
24+
\ ],
25+
\ ale_linters#typescript#typecheck#Handle(347, [
26+
\ "somets.ts[16, 7]: Type 'A' is not assignable to type 'B'",
27+
\ "somets.ts[7, 41]: Property 'a' does not exist on type 'A'",
28+
\ ])
29+
30+
After:
31+
call ale#linter#Reset()

0 commit comments

Comments
 (0)