Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

set correct Rust span end column #2325

Merged
merged 1 commit into from
Mar 8, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion autoload/ale/handlers/rust.vim
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ function! ale#handlers#rust#HandleRustErrors(buffer, lines) abort
\ 'lnum': l:span.line_start,
\ 'end_lnum': l:span.line_end,
\ 'col': l:span.column_start,
\ 'end_col': l:span.column_end,
\ 'end_col': l:span.column_end-1,
\ 'text': empty(l:span.label) ? l:error.message : printf('%s: %s', l:error.message, l:span.label),
\ 'type': toupper(l:error.level[0]),
\})
Expand Down
18 changes: 9 additions & 9 deletions test/handler/test_rust_handler.vader
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ Execute(The Rust handler should handle rustc output):
\ 'end_lnum': 15,
\ 'type': 'E',
\ 'col': 5,
\ 'end_col': 8,
\ 'end_col': 7,
\ 'text': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`',
\ },
\ {
\ 'lnum': 13,
\ 'end_lnum': 13,
\ 'type': 'E',
\ 'col': 7,
\ 'end_col': 10,
\ 'end_col': 9,
\ 'text': 'no method named `wat` found for type `std::string::String` in the current scope',
\ },
\ ],
Expand Down Expand Up @@ -84,15 +84,15 @@ Execute(The Rust handler should handle cargo output):
\ 'end_lnum': 15,
\ 'type': 'E',
\ 'col': 5,
\ 'end_col': 8,
\ 'end_col': 7,
\ 'text': 'expected one of `.`, `;`, `?`, `}`, or an operator, found `for`',
\ },
\ {
\ 'lnum': 13,
\ 'end_lnum': 13,
\ 'type': 'E',
\ 'col': 7,
\ 'end_col': 10,
\ 'end_col': 9,
\ 'text': 'no method named `wat` found for type `std::string::String` in the current scope',
\ },
\ ],
Expand Down Expand Up @@ -158,7 +158,7 @@ Execute(The Rust handler should should errors from expansion spans):
\ 'end_lnum': 4,
\ 'type': 'E',
\ 'col': 21,
\ 'end_col': 23,
\ 'end_col': 22,
\ 'text': 'mismatched types: expected bool, found integral variable',
\ },
\ ],
Expand Down Expand Up @@ -208,7 +208,7 @@ Execute(The Rust handler should show detailed errors):
\ 'end_lnum': 4,
\ 'type': 'E',
\ 'col': 21,
\ 'end_col': 23,
\ 'end_col': 22,
\ 'text': 'mismatched types: expected bool, found integral variable',
\ },
\ ],
Expand Down Expand Up @@ -296,15 +296,15 @@ Execute(The Rust handler should remove secondary spans if set):
\ 'lnum': 1,
\ 'end_lnum': 1,
\ 'type': 'E',
\ 'end_col': 21,
\ 'end_col': 20,
\ 'col': 1,
\ 'text': 'this function takes 1 parameter but 0 were supplied: defined here',
\ },
\ {
\ 'lnum': 1,
\ 'end_lnum': 1,
\ 'type': 'E',
\ 'end_col': 46,
\ 'end_col': 45,
\ 'col': 40,
\ 'text': 'this function takes 1 parameter but 0 were supplied: expected 1 parameter',
\ },
Expand Down Expand Up @@ -371,7 +371,7 @@ Execute(The Rust handler should remove secondary spans if set):
\ 'lnum': 1,
\ 'end_lnum': 1,
\ 'type': 'E',
\ 'end_col': 46,
\ 'end_col': 45,
\ 'col': 40,
\ 'text': 'this function takes 1 parameter but 0 were supplied: expected 1 parameter',
\ },
Expand Down