From 67221497762ab5a055451c40a374e03bb620a68a Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Tue, 11 Feb 2025 17:09:39 +0800 Subject: feat(lsp): include `end_col` and `end_lnum` in `vim.lsp.buf.symbols_to_items` --- runtime/doc/lsp.txt | 6 ++++-- runtime/doc/news.txt | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 25ef7f24cc..9e6aec4bf7 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -2380,8 +2380,10 @@ symbols_to_items({symbols}, {bufnr}) *vim.lsp.util.symbols_to_items()* Converts symbols to quickfix list items. Parameters: ~ - • {symbols} (`lsp.DocumentSymbol[]|lsp.SymbolInformation[]`) - • {bufnr} (`integer?`) + • {symbols} (`lsp.DocumentSymbol[]|lsp.SymbolInformation[]`) list of + symbols + • {bufnr} (`integer?`) buffer handle or 0 for current, defaults to + current Return: ~ (`vim.quickfix.entry[]`) See |setqflist()| for the format diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 90a020bb4d..8ab001bf94 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -277,7 +277,8 @@ LSP • `:checkhealth vim.lsp` displays the server version (if available). • Completion side effects (including snippet expansion, execution of commands and application of additional text edits) is now built-in. -• |vim.lsp.util.locations_to_items()| sets `end_col` and `end_lnum` fields. +• |vim.lsp.util.locations_to_items()| and |vim.lsp.util.symbols_to_items()| now + sets `end_col` and `end_lnum` fields. • |vim.lsp.buf.format()| now supports passing a list of ranges via the `range` parameter (this requires support for the `textDocument/rangesFormatting` request). -- cgit From e8b5dd1e89bfa984e7b943443a291484cba23fac Mon Sep 17 00:00:00 2001 From: Yi Ming Date: Tue, 11 Feb 2025 17:19:44 +0800 Subject: feat(lsp)!: `symbol_to_item` requires `offset_encoding` --- runtime/doc/lsp.txt | 13 ++++++++----- runtime/doc/news.txt | 1 + 2 files changed, 9 insertions(+), 5 deletions(-) (limited to 'runtime/doc') diff --git a/runtime/doc/lsp.txt b/runtime/doc/lsp.txt index 9e6aec4bf7..954d21ec34 100644 --- a/runtime/doc/lsp.txt +++ b/runtime/doc/lsp.txt @@ -2376,14 +2376,17 @@ stylize_markdown({bufnr}, {contents}, {opts}) Return: ~ (`table`) stripped content -symbols_to_items({symbols}, {bufnr}) *vim.lsp.util.symbols_to_items()* + *vim.lsp.util.symbols_to_items()* +symbols_to_items({symbols}, {bufnr}, {position_encoding}) Converts symbols to quickfix list items. Parameters: ~ - • {symbols} (`lsp.DocumentSymbol[]|lsp.SymbolInformation[]`) list of - symbols - • {bufnr} (`integer?`) buffer handle or 0 for current, defaults to - current + • {symbols} (`lsp.DocumentSymbol[]|lsp.SymbolInformation[]`) + list of symbols + • {bufnr} (`integer?`) buffer handle or 0 for current, + defaults to current + • {position_encoding} (`'utf-8'|'utf-16'|'utf-32'?`) default to first + client of buffer Return: ~ (`vim.quickfix.entry[]`) See |setqflist()| for the format diff --git a/runtime/doc/news.txt b/runtime/doc/news.txt index 8ab001bf94..92492d0448 100644 --- a/runtime/doc/news.txt +++ b/runtime/doc/news.txt @@ -133,6 +133,7 @@ LSP • |vim.lsp.util.make_position_params()|, |vim.lsp.util.make_range_params()| and |vim.lsp.util.make_given_range_params()| now require the `position_encoding` parameter. +• |vim.lsp.util.symbols_to_items()| now requires the `position_encoding` parameter. LUA -- cgit