summaryrefslogtreecommitdiff
path: root/ale_linters/elm/make.vim
diff options
context:
space:
mode:
authorHéctor Ramón Jiménez <hector0193@gmail.com>2018-05-12 04:16:14 +0200
committerHéctor Ramón Jiménez <hector0193@gmail.com>2018-05-12 04:16:14 +0200
commitc3f61c391bd74e8feb0d7d127ba353093a61b5c7 (patch)
tree70457417383b3265807fd0ef197cb9fb7c2db0bd /ale_linters/elm/make.vim
parent089a07c6a6789770d497fe12307222e24b16bbae (diff)
downloadale-c3f61c391bd74e8feb0d7d127ba353093a61b5c7.zip
Use `message` as `text` instead of `title`
`title` does not contain much information which forces to use :ALEDetail most of the time
Diffstat (limited to 'ale_linters/elm/make.vim')
-rw-r--r--ale_linters/elm/make.vim38
1 files changed, 25 insertions, 13 deletions
diff --git a/ale_linters/elm/make.vim b/ale_linters/elm/make.vim
index 2da219f5..4b354d43 100644
--- a/ale_linters/elm/make.vim
+++ b/ale_linters/elm/make.vim
@@ -20,21 +20,30 @@ function! ale_linters#elm#make#Handle(buffer, lines) abort
if l:report.type is? 'error'
" General problem
- let l:details = map(copy(l:report.message), 'ale_linters#elm#make#ParseMessageItem(v:val)')
-
- call add(l:output, {
- \ 'lnum': 1,
- \ 'type': 'E',
- \ 'text': l:report.title,
- \ 'detail': join(l:details, '')
- \})
+ let l:details = ale_linters#elm#make#ParseMessage(l:report.message)
+
+ if ale_linters#elm#make#FileIsBuffer(l:report.path)
+ call add(l:output, {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': l:details,
+ \})
+ else
+ call add(l:output, {
+ \ 'lnum': 1,
+ \ 'type': 'E',
+ \ 'text': l:report.path .' - '. l:details,
+ \ 'detail': l:report.path ." ----------\n\n". l:details,
+ \})
+ endif
+
else
" Compilation errors
for l:error in l:report.errors
let l:file_is_buffer = ale_linters#elm#make#FileIsBuffer(l:error.path)
for l:problem in l:error.problems
- let l:details = map(copy(l:problem.message), 'ale_linters#elm#make#ParseMessageItem(v:val)')
+ let l:details = ale_linters#elm#make#ParseMessage(l:problem.message)
if l:file_is_buffer
" Buffer module has problems
@@ -44,8 +53,7 @@ function! ale_linters#elm#make#Handle(buffer, lines) abort
\ 'end_lnum': l:problem.region.end.line,
\ 'end_col': l:problem.region.end.column,
\ 'type': 'E',
- \ 'text': l:problem.title,
- \ 'detail': join(l:details, '')
+ \ 'text': l:details,
\})
else
" Imported module has problems
@@ -53,8 +61,8 @@ function! ale_linters#elm#make#Handle(buffer, lines) abort
call add(l:output, {
\ 'lnum': 1,
\ 'type': 'E',
- \ 'text': l:location .' - '. l:problem.title,
- \ 'detail': l:location ." -------\n\n" . join(l:details, '')
+ \ 'text': l:location .' - '. l:details,
+ \ 'detail': l:location ." ----------\n\n". l:details,
\})
endif
endfor
@@ -88,6 +96,10 @@ function! ale_linters#elm#make#FileIsBuffer(path) abort
endif
endfunction
+function! ale_linters#elm#make#ParseMessage(message) abort
+ return join(map(copy(a:message), 'ale_linters#elm#make#ParseMessageItem(v:val)'), '')
+endfunction
+
function! ale_linters#elm#make#ParseMessageItem(item) abort
if type(a:item) == type('')
return a:item