fix(lsp): log unknown diagnostic tags instead of showing a warning (#25705)

To be more in line with the specification:

> To support the evolution of enumerations the using side of an enumeration shouldn’t fail on an enumeration value it doesn’t know. It should simply ignore it as a value it can use and try to do its best to preserve the value on round trips
This commit is contained in:
Jorge Mederos 2023-10-21 08:47:14 +02:00 committed by GitHub
parent 7a6e27958a
commit 3304449946
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@
local util = require('vim.lsp.util')
local protocol = require('vim.lsp.protocol')
local log = require('vim.lsp.log')
local ms = protocol.Methods
local api = vim.api
@ -88,10 +89,7 @@ local function tags_lsp_to_vim(diagnostic, client_id)
tags = tags or {}
tags.deprecated = true
else
vim.notify_once(
string.format('Unknown DiagnosticTag %d from LSP client %d', tag, client_id),
vim.log.levels.WARN
)
log.info(string.format('Unknown DiagnosticTag %d from LSP client %d', tag, client_id))
end
end
return tags