Home Explore Blog CI



neovim

5th chunk of `runtime/doc/news-0.10.txt`
72ab73a8d95bc8635954f71285b4582a2d2379595790b8f10000000100000ffb
 https://microsoft.github.io/language-server-protocol/specification/#textDocument_prepareTypeHierarchy
  • |vim.lsp.status()| consumes the last progress messages as a string.
  • LSP client now always saves and restores named buffer marks when applying
    text edits.
  • LSP client now supports the `positionEncoding` server capability. If a server
    responds with the `positionEncoding` capability in its initialization
    response, Nvim automatically sets the client's `offset_encoding` field.
  • Dynamic registration of LSP capabilities. An implication of this change is
    that checking a client's `server_capabilities` is no longer a sufficient
    indicator to see if a server supports a feature. Instead use
    `client.supports_method(<method>)`. It considers both the dynamic
    capabilities and static `server_capabilities`.
  • `anchor_bias` option to lsp-handlers aids in positioning of floating
    windows.
  • |vim.lsp.util.locations_to_items()| sets the `user_data` of each item to
    the original LSP `Location` or `LocationLink`.
  • Added support for connecting to servers using named pipes (Windows) or
    Unix domain sockets (Unix) via |vim.lsp.rpc.connect()|.
  • Added support for `completionList.itemDefaults`, reducing overhead when
    computing completion items where properties often share the same value
    (e.g. `commitCharacters`). Note that this might affect plugins and
    language servers that don't support the feature, and in such cases the
    respective capability can be unset.
  • |vim.lsp.start()| accepts a "silent" option for suppressing messages
    if an LSP server failed to start.
  • |vim.lsp.buf.definition()|, |vim.lsp.buf.declaration()|,
    |vim.lsp.buf.type_definition()|, and |vim.lsp.buf.implementation()| now
    support the `loclist` field of |vim.lsp.ListOpts|.

• Lua:
  • |:lua| with a |[range]| executes that range as Lua code, in any buffer.
  • |:source| without arguments treats a buffer with 'filetype' of "lua" as
    Lua code regardless of its extension.
  • Vimscript function |exists()| supports checking |v:lua| functions.
  • |vim.iter()| is a generic interface for all |iterable| objects (tables,
    |iterator|s).
  • |vim.snippet| provides a mode for expanding and navigating snippets.
  • |vim.ringbuf()| is a generic ring buffer (data structure).
  • |vim.deepcopy()| gained a `noref` argument to avoid hashing table values.
  • |vim.keycode()| translates keycodes in a string.
  • |vim.system()| runs commands / starts processes.
  • |vim.lpeg| and |vim.re| expose the bundled Lpeg expression grammar parser
    and its regex interface.
  • |vim.base64.encode()| and |vim.base64.decode()| encode and decode strings
    using Base64 encoding.
  • |vim.text.hexencode()| and |vim.text.hexdecode()| convert strings to and
    from byte representations.
  • |vim.ui.open()| opens URIs using the system default handler (macOS `open`,
    Windows `explorer`, Linux `xdg-open`, etc.)
  • |vim.wo| can now be double indexed for |:setlocal| behaviour. Currently
    only `0` for the buffer index is supported.
  • Improved messages for type errors in `vim.api.*` calls (including `opts` params).
  • Lua type annotations for:
    • `vim.*`
    • `vim.fn.*`
    • `vim.api.*`
    • `vim.v.*`
  • Functions that take a severity as an optional parameter (e.g.
    |vim.diagnostic.get()|) now also accept a list of severities |vim.diagnostic.severity|
  • |vim.diagnostic.count()| returns the number of diagnostics for a given
    buffer and/or namespace, by severity. This is a faster alternative to
    |vim.diagnostic.get()| when only the number of diagnostics is needed, but
    not the diagnostics themselves.
  • |vim.diagnostic.is_enabled()|
  • |vim.version.le()|, |vim.version.ge()|
  • |vim.fs.root()| finds project root directories from a list of "root
    markers".
  • |vim.tbl_contains()| now works for general tables and allows specifying
    a predicate function that is checked for each value. (Use
    |vim.list_contains()|

Title: Nvim 0.10 Release Notes: New Features (LSP, Lua)
Summary
Nvim 0.10 introduces new features primarily in LSP and Lua. LSP improvements include connection options (named pipes/sockets), `completionList.itemDefaults`, a silent start option, and loclist support. Lua gains range execution, filetype handling, `v:lua` function checks, iterators, snippet management, a ring buffer, deepcopy options, keycode translation, system commands, parsing tools, base64/hex encoding, URI opening, `vim.wo` indexing, better type errors, annotations, severity lists, diagnostic counts, is_enabled check, version comparisons, root finding, and tbl_contains enhancements.