aboutsummaryrefslogtreecommitdiff
path: root/test/functional/plugin/lsp/codelens_spec.lua
Commit message (Collapse)AuthorAge
* test(harness): migrate away from magic globalsJustin M. Keyes2026-07-21
| | | | | | | | | | | | | | | | | | | | | Problem: The magic globals `it`, `describe`, etc., are more trouble than they are worth. - Hooking into `after_each` requires `getfenv()` hacks. - They confuse luals/emmylua, because the top-level `.luarc.json` isn't merged with `test/.luarc.json` (apparently a luals limitation?) - They totally defeat discoverability because the user just has to "know" about the various magic symbols. So they harm DX, which means they serve no purpose at all. Solution: - Expose the test API from `testutil`, so tests can call `t.it()`, `t.describe()`, etc., in the conventional way. - Drop `getfenv()` hacks. - Drop the `setfenv()` injection in `load_chunk`. - Drop `test/_meta.lua`.
* refactor(lsp): use LspNotify for codelens #40604jdrouhard2026-07-07
| | | | | | | | | | | | | | | | | | | | | Problem: The codelens LSP module was using its own raw buffer events and its own debounce mechanism for refreshing code lens in attached buffers. Solution: Switch the module to using the LspNotify autocmd events. LspNotify fires just after document versions are synced with the server and provides a built in debounce mechanism for changes. Additionally, this fixes some bugs with the previous implementation: 1. The workspace/codeLens/refresh handler re-requested codelens for all buffers but when the response came back, it forced an extra redraw after clearing the work the handler had just done. 2. Document synchronization was reworked to be more resilient to multiple clients providing codelens for a single buffer. The latest document version is now separately tracked per client (and per client's lenses per row) instead of for the buffer as a whole. This allows the on_win() function to properly redraw all codelens even when different clients' responses for a particular document version come back at different times.
* fix(lsp): refresh codelens despite pending debounce #40154Tristan Knight2026-06-10
| | | | | | | | | | | Problem: When a server sends workspace/codeLens/refresh while an automatic codelens request is already scheduled, Nvim ignores the server refresh. This can leave rendered codelens text stale until another buffer edit triggers a new request. Solution: Cancel the pending automatic request and send the server-requested refresh immediately. This preserves request coalescing while giving explicit server refreshes priority.
* fix(lsp): skip codelens refresh redraw for deleted buffer #39193Jaehwang Jung2026-04-18
| | | | | | | | | | | | Problem: After on_refresh() sends a textDocument/codeLens request, the buffer may be deleted before the response arrives. The response callback then tries to redraw that deleted buffer and raises Invalid buffer id error. Solution: Check buffer validity before redrawing. AI-assisted: Codex Co-authored-by: Yi Ming <ofseed@foxmail.com>
* fix(lsp): redraw codelens after request completed #38352Yi Ming2026-03-18
| | | | | | | Problem: When code lens is enabled, `on_attach` is executed, but it does not trigger a redraw. Another event, eg, moving the cursor, is required to trigger a redraw and execute the decoration provider's `on_win`. Solution: Trigger a `redraw` after each request is completed.
* fix(lsp): do not clear the codelens on the last line #38226Yi Ming2026-03-10
| | | | | | | Problem The logic that clears codelenses beyond the buffer also removes the codelenses on the last line. Solution Do not clear the codelens on the last line.
* fix(lsp): ensure the codelens on the first line is visibleYi Ming2026-03-08
|
* fix(lsp): adjust codelens position based on the server-provided rangeYi Ming2026-03-08
|
* fix(lsp): ignore stale codelens resolve responses (#38153)Lewis Russell2026-03-04
|
* test: remove remaining use of feed_command() in terminal/ (#38069)zeertzjq2026-02-26
| | | Also deduplicate screen lines in some other tests.
* feat(lsp): display codelens as virtual lines, not virtual text #36469Mike J McGuirk2026-02-08
| | | | | | | | | | | | Problem: Code lenses currently display as virtual text on the same line and after the relevant item. While the spec does not say how lenses should be rendered, above the line is most typical. For longer lines, lenses rendered as virtual text can run off the side of the screen. Solution: Display lenses as virtual lines above the text. Closes https://github.com/neovim/neovim/issues/33923 Co-authored-by: Yi Ming <ofseed@foxmail.com>
* feat(lsp): support `workspace/codeLens/refresh`Yi Ming2026-02-03
|
* feat(lsp)!: reimplement `textDocument/codeLens` as decoration providerYi Ming2026-02-03
|
* test: don't call clear() in both before_each() and after_each() (#35901)zeertzjq2025-09-24
|
* test: support upvalues in exec_luaLewis Russell2024-09-21
|
* test: improve test conventionsdundargoc2024-04-23
| | | | | | | | | Specifically, functions that are run in the context of the test runner are put in module `test/testutil.lua` while the functions that are run in the context of the test session are put in `test/functional/testnvim.lua`. Closes https://github.com/neovim/neovim/issues/27004.
* refactor(test): inject after_each differentlyLewis Russell2024-04-10
|
* test: improve test conventionsdundargoc2024-04-08
| | | | Work on https://github.com/neovim/neovim/issues/27004.
* refactor: format test/*Justin M. Keyes2024-01-03
|
* feat(lsp): add function to clear codelens (#21504)Mathias Fußenegger2022-12-31
| | | | | | | | Currently once you retrieve the lenses you're pretty much stuck with them as saving new lenses is additive. Adding a dedicated method to reset lenses allows users to toggle lenses on/off which can be useful for language servers where they are noisy or expensive and you only want to see them temporary.
* feat(lsp): add per-client commands (#16101)Michael Lingelbach2021-11-01
|
* feat(lsp): add client command support to codelens (#15820)Mathias Fußenegger2021-09-28
| | | | Also adds a check against the server capabilities to fix https://github.com/neovim/neovim/issues/15183
* feat(lsp)!: change handler signatureMichael Lingelbach2021-09-05
| | | | | | | | | | | | | | | | | | | | | | | | Previously, the handler signature was: function(err, method, params, client_id, bufnr, config) In order to better support external plugins that wish to extend the protocol, there is other information which would be advantageous to forward to the client, such as the original params of the request that generated the callback. In order to do this, we would need to break symmetry of the handlers, to add an additional "params" as the 7th argument. Instead, this PR changes the signature of the handlers to: function(err, result, ctx, config) where ctx (the context) includes params, client_id, and bufnr. This also leaves flexibility for future use-cases. BREAKING_CHANGE: changes the signature of the built-in client handlers, requiring updating handler calls
* test(lsp): file URIs do not allow relative pathsAlessandro Pezzoni2021-07-10
|
* feat(lsp): Add codelens supportMathias Fussenegger2021-06-14