summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorDalius Dobravolskas <daliusd@wix.com>2021-09-16 16:05:38 +0300
committerGitHub <noreply@github.com>2021-09-16 22:05:38 +0900
commitdca56dd77267d6cedc3785f1359dd96d1f4b3fa9 (patch)
treee41aa1cb6777ab6eb15b16982f0ddb74a27cd01c /test
parent31349f208bf186bab90e51fddc09493fe28a19d8 (diff)
downloadale-dca56dd77267d6cedc3785f1359dd96d1f4b3fa9.zip
ALECodeAction fix: check linter name when searching for nearest error. (#3901)
It is easier to explain this fix with an example: * tsserver and LSPs ask for error information when you want to fix error. tsserver `ts@getCodeFixes` command needs tsserver error code. * now let's imagine that user has eslint and tsserver in use. Sometimes both can report same error in different way. * Now there is no guarantee which error will come first and if eslint error comes first then tsserver will not return code fixes as we are passing wrong error code to it. This fix will return proper error code based on linter.
Diffstat (limited to 'test')
-rw-r--r--test/test_codefix.vader4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/test_codefix.vader b/test/test_codefix.vader
index fc5470aa..a9fff89d 100644
--- a/test/test_codefix.vader
+++ b/test/test_codefix.vader
@@ -280,7 +280,7 @@ Execute(tsserver codefix requests should be sent):
call ale#linter#Reset()
runtime ale_linters/typescript/tsserver.vim
- let g:ale_buffer_info = {bufnr(''): {'loclist': [{'lnum': 2, 'col': 5, 'code': 2304}]}}
+ let g:ale_buffer_info = {bufnr(''): {'loclist': [{'lnum': 2, 'col': 5, 'code': 2304, 'linter_name': 'tsserver'}]}}
call setpos('.', [bufnr(''), 2, 16, 0])
" ALECodeAction
@@ -314,7 +314,7 @@ Execute(tsserver codefix requests should be sent only for error with code):
call ale#linter#Reset()
runtime ale_linters/typescript/tsserver.vim
- let g:ale_buffer_info = {bufnr(''): {'loclist': [{'lnum': 2, 'col': 16}, {'lnum': 2, 'col': 16, 'code': 2304}]}}
+ let g:ale_buffer_info = {bufnr(''): {'loclist': [{'lnum': 2, 'col': 16, 'linter_name': 'tsserver'}, {'lnum': 2, 'col': 16, 'code': 2304, 'linter_name': 'tsserver'}]}}
call setpos('.', [bufnr(''), 2, 16, 0])
" ALECodeAction