Skip to content

refactor: migrate to Neovim 0.11+ APIs - #535

Merged
sidlatau merged 1 commit into
mainfrom
refactor/nvim-0.11-apis
Sep 8, 2026
Merged

sidlatau merged 1 commit into
mainfrom
refactor/nvim-0.11-apis

Conversation

@sidlatau

@sidlatau sidlatau commented Sep 8, 2026

Copy link
Copy Markdown
Collaborator

Replaces APIs deprecated in 0.11 (and slated for removal in 0.13) with their current equivalents, now that the README already requires 0.11+.

  • Method-call form for client:request/notify/supports_method; drops the has("nvim-0.12") branch in on_init.
  • vim.highlight → vim.hl, nvim_buf_add_highlight → nvim_buf_set_extmark. strict = false preserves the old behaviour of clamping an end column past the end of the line rather than raising.
  • Devtools open through vim.ui.open, removing utils.open_command. Keeps detach = true and adds WSL support for free.
  • utils.lsp_handler is gone — all three Dart handlers already use the new (err, result, ctx, config) signature.
  • M.restart() uses Client:stop() + vim.lsp.start per buffer. stop() sets _is_stopping synchronously and reuse_client_default checks is_stopped(), so the first start spawns the replacement and the rest attach to it.
  • Fixes includeexpr being set with vim.opt instead of vim.opt_local in the dart ftplugin, where it leaked into every other buffer.

User-visible

  • New FlutterToolsDimmed highlight group, linked to 0.13's core Dimmed group where available and to Comment otherwise. It is now the default for closing tags and is used for outline return types and menu hints. Visually unchanged unless a colourscheme defines Dimmed differently.
  • closing_tags.highlight now defaults to FlutterToolsDimmed rather than Comment.
  • utils.open_command and utils.lsp_handler are removed. Undocumented, but reachable via require("flutter-tools.utils").

- use method-call form for client request/notify/supports_method
- replace vim.highlight with vim.hl, nvim_buf_add_highlight with extmarks
  (strict = false preserves the old clamping of out-of-range end columns)
- open devtools via vim.ui.open, dropping utils.open_command
- drop utils.lsp_handler, only the new handler signature exists now
- restart dartls via Client:stop + vim.lsp.start; stop() marks the client
  stopping synchronously so reuse_client won't hand back the dying one
- add FlutterToolsDimmed, linked to 0.13's core Dimmed group where
  available and Comment otherwise; now the default for closing tags
- fix includeexpr leaking globally from the dart ftplugin
@sidlatau
sidlatau merged commit 4f59595 into main Sep 8, 2026
7 checks passed
@sidlatau
sidlatau deleted the refactor/nvim-0.11-apis branch September 8, 2026 14:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant