fix(diagnostic): don't return nil when callers expect a table (#15765)

diagnostic_lines() returns a table, so make the early exit condition an
empty table rather than 'nil'. This way, functions that use the input
from diagnostic_lines don't have to do a bunch of defensive nil checking
and can always assume they're operating on a table.
This commit is contained in:
Gregory Anders 2021-09-23 09:23:57 -06:00 committed by GitHub
parent abf13258cf
commit 057606e845
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -249,7 +249,7 @@ end
---@private
local function diagnostic_lines(diagnostics)
if not diagnostics then
return
return {}
end
local diagnostics_by_line = {}