Use message as text instead of title

`title` does not contain much information which forces to use :ALEDetail most of the time
This commit is contained in:
Héctor Ramón Jiménez
2018-05-12 04:16:14 +02:00
parent 089a07c6a6
commit c3f61c391b
2 changed files with 48 additions and 29 deletions

View File

@@ -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)')
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
call add(l:output, {
\ 'lnum': 1,
\ 'type': 'E',
\ 'text': l:report.title,
\ 'detail': join(l:details, '')
\})
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