243
243
---@param client_id number
244
244
---@private
245
245
function M.save(diagnostics, bufnr, client_id)
246
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.save is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
246
+
vim.notify_once('vim.lsp.diagnostic.save is deprecated. See :h deprecated', vim.log.levels.WARN)
247
247
local namespace = M.get_namespace(client_id)
248
248
vim.diagnostic.set(namespace, bufnr, diagnostic_lsp_to_vim(diagnostics, bufnr, client_id))
249
249
end
257
257
--- If nil, diagnostics of all clients are included.
258
258
---@return table with diagnostics grouped by bufnr (bufnr: Diagnostic[])
259
259
function M.get_all(client_id)
260
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get_all is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
260
+
vim.notify_once('vim.lsp.diagnostic.get_all is deprecated. See :h deprecated', vim.log.levels.WARN)
261
261
local result = {}
262
262
local namespace
263
263
if client_id then
279
279
--- Else, return just the diagnostics associated with the client_id.
280
280
---@param predicate function|nil Optional function for filtering diagnostics
281
281
function M.get(bufnr, client_id, predicate)
282
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
282
+
vim.notify_once('vim.lsp.diagnostic.get is deprecated. See :h deprecated', vim.log.levels.WARN)
283
283
predicate = predicate or function() return true end
284
284
if client_id == nil then
285
285
local all_diagnostics = {}
341
341
---@param severity DiagnosticSeverity
342
342
---@param client_id number the client id
343
343
function M.get_count(bufnr, severity, client_id)
344
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get_count is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
344
+
vim.notify_once('vim.lsp.diagnostic.get_count is deprecated. See :h deprecated', vim.log.levels.WARN)
345
345
severity = severity_lsp_to_vim(severity)
346
346
local opts = { severity = severity }
347
347
if client_id ~= nil then
358
358
---@param opts table See |vim.lsp.diagnostic.goto_next()|
359
359
---@return table Previous diagnostic
360
360
function M.get_prev(opts)
361
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get_prev is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
361
+
vim.notify_once('vim.lsp.diagnostic.get_prev is deprecated. See :h deprecated', vim.log.levels.WARN)
362
362
if opts then
363
363
if opts.severity then
364
364
opts.severity = severity_lsp_to_vim(opts.severity)
376
376
---@param opts table See |vim.lsp.diagnostic.goto_next()|
377
377
---@return table Previous diagnostic position
378
378
function M.get_prev_pos(opts)
379
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get_prev_pos is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
379
+
vim.notify_once('vim.lsp.diagnostic.get_prev_pos is deprecated. See :h deprecated', vim.log.levels.WARN)
380
380
if opts then
381
381
if opts.severity then
382
382
opts.severity = severity_lsp_to_vim(opts.severity)
393
393
---
394
394
---@param opts table See |vim.lsp.diagnostic.goto_next()|
395
395
function M.goto_prev(opts)
396
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.goto_prev is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
396
+
vim.notify_once('vim.lsp.diagnostic.goto_prev is deprecated. See :h deprecated', vim.log.levels.WARN)
397
397
if opts then
398
398
if opts.severity then
399
399
opts.severity = severity_lsp_to_vim(opts.severity)
411
411
---@param opts table See |vim.lsp.diagnostic.goto_next()|
412
412
---@return table Next diagnostic
413
413
function M.get_next(opts)
414
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get_next is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
414
+
vim.notify_once('vim.lsp.diagnostic.get_next is deprecated. See :h deprecated', vim.log.levels.WARN)
415
415
if opts then
416
416
if opts.severity then
417
417
opts.severity = severity_lsp_to_vim(opts.severity)
429
429
---@param opts table See |vim.lsp.diagnostic.goto_next()|
430
430
---@return table Next diagnostic position
431
431
function M.get_next_pos(opts)
432
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get_next_pos is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
432
+
vim.notify_once('vim.lsp.diagnostic.get_next_pos is deprecated. See :h deprecated', vim.log.levels.WARN)
433
433
if opts then
434
434
if opts.severity then
435
435
opts.severity = severity_lsp_to_vim(opts.severity)
444
444
---
445
445
---@deprecated Prefer |vim.diagnostic.goto_next()|
446
446
function M.goto_next(opts)
447
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.goto_next is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
447
+
vim.notify_once('vim.lsp.diagnostic.goto_next is deprecated. See :h deprecated', vim.log.levels.WARN)
448
448
if opts then
449
449
if opts.severity then
450
450
opts.severity = severity_lsp_to_vim(opts.severity)
468
468
--- - severity_limit (DiagnosticSeverity):
469
469
--- - Limit severity of diagnostics found. E.g. "Warning" means { "Error", "Warning" } will be valid.
470
470
function M.set_signs(diagnostics, bufnr, client_id, _, opts)
471
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.set_signs is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
471
+
vim.notify_once('vim.lsp.diagnostic.set_signs is deprecated. See :h deprecated', vim.log.levels.WARN)
472
472
local namespace = M.get_namespace(client_id)
473
473
if opts and not opts.severity and opts.severity_limit then
474
474
opts.severity = {min=severity_lsp_to_vim(opts.severity_limit)}
489
489
--- - severity_limit (DiagnosticSeverity):
490
490
--- - Limit severity of diagnostics found. E.g. "Warning" means { "Error", "Warning" } will be valid.
491
491
function M.set_underline(diagnostics, bufnr, client_id, _, opts)
492
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.set_underline is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
492
+
vim.notify_once('vim.lsp.diagnostic.set_underline is deprecated. See :h deprecated', vim.log.levels.WARN)
493
493
local namespace = M.get_namespace(client_id)
494
494
if opts and not opts.severity and opts.severity_limit then
495
495
opts.severity = {min=severity_lsp_to_vim(opts.severity_limit)}
511
511
--- - severity_limit (DiagnosticSeverity):
512
512
--- - Limit severity of diagnostics found. E.g. "Warning" means { "Error", "Warning" } will be valid.
513
513
function M.set_virtual_text(diagnostics, bufnr, client_id, _, opts)
514
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.set_virtual_text is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
514
+
vim.notify_once('vim.lsp.diagnostic.set_virtual_text is deprecated. See :h deprecated', vim.log.levels.WARN)
515
515
local namespace = M.get_namespace(client_id)
516
516
if opts and not opts.severity and opts.severity_limit then
517
517
opts.severity = {min=severity_lsp_to_vim(opts.severity_limit)}
530
530
---@return an array of [text, hl_group] arrays. This can be passed directly to
531
531
--- the {virt_text} option of |nvim_buf_set_extmark()|.
532
532
function M.get_virtual_text_chunks_for_line(bufnr, _, line_diags, opts)
533
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.get_virtual_text_chunks_for_line is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
533
+
vim.notify_once('vim.lsp.diagnostic.get_virtual_text_chunks_for_line is deprecated. See :h deprecated', vim.log.levels.WARN)
534
534
return vim.diagnostic._get_virt_text_chunks(diagnostic_lsp_to_vim(line_diags, bufnr), opts)
535
535
end
536
536
548
548
---@param position table|nil The (0,0)-indexed position
549
549
---@return table {popup_bufnr, win_id}
550
550
function M.show_position_diagnostics(opts, buf_nr, position)
551
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.show_position_diagnostics is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
551
+
vim.notify_once('vim.lsp.diagnostic.show_position_diagnostics is deprecated. See :h deprecated', vim.log.levels.WARN)
552
552
opts = opts or {}
553
553
opts.scope = "cursor"
554
554
opts.pos = position
572
572
---@param client_id number|nil the client id
573
573
---@return table {popup_bufnr, win_id}
574
574
function M.show_line_diagnostics(opts, buf_nr, line_nr, client_id)
575
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.show_line_diagnostics is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
575
+
vim.notify_once('vim.lsp.diagnostic.show_line_diagnostics is deprecated. See :h deprecated', vim.log.levels.WARN)
576
576
opts = opts or {}
577
577
opts.scope = "line"
578
578
opts.pos = line_nr
596
596
--- client. The default is to redraw diagnostics for all attached
597
597
--- clients.
598
598
function M.redraw(bufnr, client_id)
599
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.redraw is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
599
+
vim.notify_once('vim.lsp.diagnostic.redraw is deprecated. See :h deprecated', vim.log.levels.WARN)
600
600
bufnr = get_bufnr(bufnr)
601
601
if not client_id then
602
602
return vim.lsp.for_each_buffer_client(bufnr, function(client)
624
624
--- - {workspace}: (boolean, default true)
625
625
--- - Set the list with workspace diagnostics
626
626
function M.set_qflist(opts)
627
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.set_qflist is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
627
+
vim.notify_once('vim.lsp.diagnostic.set_qflist is deprecated. See :h deprecated', vim.log.levels.WARN)
628
628
opts = opts or {}
629
629
if opts.severity then
630
630
opts.severity = severity_lsp_to_vim(opts.severity)
656
656
--- - {workspace}: (boolean, default false)
657
657
--- - Set the list with workspace diagnostics
658
658
function M.set_loclist(opts)
659
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.set_loclist is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
659
+
vim.notify_once('vim.lsp.diagnostic.set_loclist is deprecated. See :h deprecated', vim.log.levels.WARN)
660
660
opts = opts or {}
661
661
if opts.severity then
662
662
opts.severity = severity_lsp_to_vim(opts.severity)
684
684
-- send diagnostic information and the client will still process it. The
685
685
-- diagnostics are simply not displayed to the user.
686
686
function M.disable(bufnr, client_id)
687
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.disable is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
687
+
vim.notify_once('vim.lsp.diagnostic.disable is deprecated. See :h deprecated', vim.log.levels.WARN)
688
688
if not client_id then
689
689
return vim.lsp.for_each_buffer_client(bufnr, function(client)
690
690
M.disable(bufnr, client.id)
705
705
--- client. The default is to enable diagnostics for all attached
706
706
--- clients.
707
707
function M.enable(bufnr, client_id)
708
-
vim.api.nvim_echo({{'vim.lsp.diagnostic.enable is deprecated. See :h deprecated', 'WarningMsg'}}, true, {})
708
+
vim.notify_once('vim.lsp.diagnostic.enable is deprecated. See :h deprecated', vim.log.levels.WARN)
709
709
if not client_id then
710
710
return vim.lsp.for_each_buffer_client(bufnr, function(client)
711
711
M.enable(bufnr, client.id)
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4