File tree Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Expand file tree Collapse file tree 1 file changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,10 @@ function! lsp#ui#vim#diagnostics#document_diagnostics() abort
51
51
endif
52
52
endfunction
53
53
54
+ " Returns a diagnostic object, or empty dictionary if no diagnostics are available.
55
+ "
56
+ " Note: Consider renaming this method (s/diagnostics/diagnostic) to make
57
+ " it clear that it returns just one diagnostic, not a list.
54
58
function ! lsp#ui#vim#diagnostics#get_diagnostics_under_cursor () abort
55
59
let l: diagnostics = s: get_all_buffer_diagnostics ()
56
60
if ! len (l: diagnostics )
@@ -60,7 +64,7 @@ function! lsp#ui#vim#diagnostics#get_diagnostics_under_cursor() abort
60
64
let l: line = line (' .' )
61
65
let l: col = col (' .' )
62
66
63
- let l: closest_diagnostics = {}
67
+ let l: closest_diagnostic = {}
64
68
let l: closest_distance = -1
65
69
66
70
for l: diagnostic in l: diagnostics
@@ -72,13 +76,13 @@ function! lsp#ui#vim#diagnostics#get_diagnostics_under_cursor() abort
72
76
if l: line == l: start_line
73
77
let l: distance = abs (l: start_col - l: col )
74
78
if l: closest_distance < 0 || l: distance < l: closest_distance
75
- let l: closest_diagnostics = l: diagnostic
79
+ let l: closest_diagnostic = l: diagnostic
76
80
let l: closest_distance = l: distance
77
81
endif
78
82
endif
79
83
endfor
80
84
81
- return l: closest_diagnostics
85
+ return l: closest_diagnostic
82
86
endfunction
83
87
84
88
function ! lsp#ui#vim#diagnostics#next_error () abort
You can’t perform that action at this time.
0 commit comments