aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/codelens.lua
Commit message (Collapse)AuthorAge
* refactor: use nvim.foo.bar format for autocommand groupsMaria José Solano2025-01-14
|
* refactor: use nvim.foo.bar format for namespacesMaria José Solano2025-01-14
|
* refactor: add vim._resolve_bufnrLewis Russell2024-12-07
|
* feat(lsp): deprecate non-method client functionsLewis Russell2024-11-20
| | | | | | | | | | | | | | Deprecated: - `client.request()` -> `client:request()` - `client.request_sync()` -> `client:request_sync()` - `client.notify()` -> `client:notify()` - `client.cancel_request()` -> `client:cancel_request()` - `client.stop()` -> `client:stop()` - `client.is_stopped()` `client:is_stopped()` - `client.supports_method()` -> `client:supports_method()` - `client.on_attach()` -> `client:on_attach()` Fixed docgen to link class fields to the full function doc.
* feat(lsp)!: remove client-server handlers from vim.lsp.handlersLewis Russell2024-11-01
| | | | | | | | | | - Partition the handlers in vim.lsp.handlers as: - client to server response handlers (RCS) - server to client request handlers (RSC) - server to client notification handlers (NSC) Note use string indexes instead of protocol.methods for improved typing in LuaLS (tip: use hover on RCS, RSC or NSC).
* feat(lsp): deprecate execute_command with client:exec_cmdLewis Russell2024-10-24
|
* fix(lsp): don't show codelens for buffers that don't support it (#29690)Riley Bruins2024-07-16
|
* fix(lsp): hide layout in codelenses in virtual text (#28794) (#28807)Mango The Fourth2024-05-21
| | | | | | | Problem: layout i.e. whitespace that is part of codelenses is currently displayed as weird symbols and large amounts of spaces Solution: replace all consecutive whitespace symbols with a single space character when trying to display codelenses as virtual text
* fix(lsp): prevent code-lens refresh from becoming a permanent no-op (#28228)Yi Ming2024-04-10
| | | | | | To avoid repeatedly requesting a buffer multiple times before a request is completed, the current implementation puts the requested buffer into the active_refreshes table before requesting. But since we only remove the buffer from active_refreshes in the lsp-handler of textDocument/codeLens, this will cause if the user sends a request that cannot trigger lsp-handler (for example, if there is an LSP server attached to the current buffer, and especially when the user creates an autocmd which performs vim.lsp.codelens.refresh after the BufEnter event is triggered like in the document example), this buffer will be put into active_refreshes, and there is no way to remove it, which will result in all subsequent vim.lsp.codelens.refresh not requesting textDocument/codeLens.
* fix(lsp): empty commands should not be considered executable (#28216)Yi Ming2024-04-10
| | | According to the LSP specification, the CodeLens.command is optional but the CodeLens.command.command is not optional, which means the correct representation of a display-only code lens is indeed one with a command with a title to display and an empty string as command.
* fix(lsp): create codelens request parameters for each buffer (#27699)Takuya Tokuda2024-03-17
|
* docs: improve/add documentation of Lua typesLewis Russell2024-03-01
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Added `@inlinedoc` so single use Lua types can be inlined into the functions docs. E.g. ```lua --- @class myopts --- @inlinedoc --- --- Documentation for some field --- @field somefield integer --- @param opts myOpts function foo(opts) end ``` Will be rendered as ``` foo(opts) Parameters: - {opts} (table) Object with the fields: - somefield (integer) Documentation for some field ``` - Marked many classes with with `@nodoc` or `(private)`. We can eventually introduce these when we want to.
* feat(docs): replace lua2dox.luaLewis Russell2024-02-27
| | | | | | | | | | | | | | | | | | | | | | | | | | Problem: The documentation flow (`gen_vimdoc.py`) has several issues: - it's not very versatile - depends on doxygen - doesn't work well with Lua code as it requires an awkward filter script to convert it into pseudo-C. - The intermediate XML files and filters makes it too much like a rube goldberg machine. Solution: Re-implement the flow using Lua, LPEG and treesitter. - `gen_vimdoc.py` is now replaced with `gen_vimdoc.lua` and replicates a portion of the logic. - `lua2dox.lua` is gone! - No more XML files. - Doxygen is now longer used and instead we now use: - LPEG for comment parsing (see `scripts/luacats_grammar.lua` and `scripts/cdoc_grammar.lua`). - LPEG for C parsing (see `scripts/cdoc_parser.lua`) - Lua patterns for Lua parsing (see `scripts/luacats_parser.lua`). - Treesitter for Markdown parsing (see `scripts/text_utils.lua`). - The generated `runtime/doc/*.mpack` files have been removed. - `scripts/gen_eval_files.lua` now instead uses `scripts/cdoc_parser.lua` directly. - Text wrapping is implemented in `scripts/text_utils.lua` and appears to produce more consistent results (the main contributer to the diff of this change).
* refactor(lsp): resolve the config-client entanglementLewis Russell2024-02-13
| | | | | | | | | | | | | | | | | | | | | Previously the LSP-Client object contained some fields that are also in the client config, but for a lot of other fields, the config was used directly making the two objects vaguely entangled with either not having a clear role. Now the config object is treated purely as config (read-only) from the client, and any fields the client needs from the config are now copied in as additional fields. This means: - the config object is no longet normalised and is left as the user provided it. - the client only reads the config on creation of the client and all other implementations now read the clients version of the fields. In addition, internal support for multiple callbacks has been added to the client so the client tracking logic (done in lua.lsp) can be done more robustly instead of wrapping the user callbacks which may error.
* feat(lsp): add opts paramater to vim.lsp.codelens.refreshMaria José Solano2024-02-08
|
* refactor(lsp): tidy up loggingLewis Russell2024-02-08
|
* refactor(lsp): move client code to a regular Lua classLewis Russell2024-02-07
| | | | | | | | | | Problem: The LSP client code is implemented as a complicated closure-class (class defined in a single function). Solution: Move LSP client code to a more conventional Lua class and move to a separate file.
* feat(lsp): more annotationsLewis Russell2023-12-14
|
* fix(lsp): clear codelens on LspDetach (#24903)Jaehwang Jung2023-09-21
| | | Also fix incorrect parameters in on_detach callback.
* docs: replace <pre> with ``` (#25136)Gregory Anders2023-09-14
|
* refactor(lsp): use protocol.Methods instead of strings #24537Raphael2023-08-03
|
* docs(lua): more improvements (#24387)Lewis Russell2023-07-18
| | | | | | | | | | | | | | | | | * docs(lua): teach lua2dox how to table * docs(lua): teach gen_vimdoc.py about local functions No more need to mark local functions with @private * docs(lua): mention @nodoc and @meta in dev-lua-doc * fixup! Co-authored-by: Justin M. Keyes <justinkz@gmail.com> --------- Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* fix(lsp): lint warnings, default offset_encoding #24046Raphael2023-07-01
| | | | | - fix lint / analysis warnings - locations_to_items(): get default offset_encoding from active client - character_offset(): get default offset_encoding from active client
* refactor(lsp): extract common execute command functionality (#24065)Mathias Fußenegger2023-06-20
|
* fix(codelens): add buffer and line checks before displaying codelens (#23887)Rohit Sukumaran2023-06-13
| | | Co-authored-by: Rohit Sukumaran <rohit.sukumaran@kredx.com>
* feat(lsp): set kind in select call for codelens #23889Artyom Andreev2023-06-03
|
* feat(lua): vim.tbl_contains supports general tables and predicates (#23040)Christian Clason2023-04-14
| | | | | | | | | | | | * feat(lua): vim.tbl_contains supports general tables and predicates Problem: `vim.tbl_contains` only works for list-like tables (integer keys without gaps) and primitive values (in particular, not for nested tables). Solution: Rename `vim.tbl_contains` to `vim.list_contains` and add new `vim.tbl_contains` that works for general tables and optionally allows `value` to be a predicate function that is checked for every key.
* docs(lsp): change type annotations from number → integer (#22510)Jaehwang Jung2023-03-07
|
* 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.
* docs(gen): support language annotation in docstringsChristian Clason2022-12-02
|
* feat(lsp): sort codelens if multiple item per line (#18951)rhcher2022-06-13
|
* chore: format runtime with styluaChristian Clason2022-05-09
|
* fix(lsp): make sure to always reset active codelens refreshes (#18331)William Boman2022-05-05
| | | | | | | | | | | This fixes issues where subsequent calls to vim.lsp.codelens.refresh() would have no effect due to the buffer not getting cleared from the active_refresh table. Examples of how such scenarios would occur are: - A textDocument/codeLens result yielded an error. - The 'textDocument/codeLens' handler was overriden in such a way that it no longer called vim.lsp.codelens.on_codelens().
* feat(lsp): add per-client commands (#16101)Michael Lingelbach2021-11-01
|
* feat(lsp): set codelens virtual text hl_mode to combine (#16048)sim2021-10-19
| | | | | It looks a bit off with the extmark going over the cursorline. (With hl_mode combine it keeps the background of the cursorline under the codelens virtualtext)
* feat(lsp): use vim.ui.select() in codelenses (#16004)Josa Gesell2021-10-18
| | | Co-authored-by: Michael Lingelbach <m.j.lbach@gmail.com> Mathias Fußenegger <mfussenegger@users.noreply.github.com>
* 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
* fix(lsp): adapt codelens resolve to handler signature change (#15578)Mathias Fußenegger2021-09-06
| | | Follow up to https://github.com/neovim/neovim/pull/15504
* Merge pull request #15504 from mjlbach/feat/change-handler-signatureMichael Lingelbach2021-09-05
|\ | | | | feat(lsp)!: change handler signature
| * 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
* | docs(lsp): document codelens.get bufnr parameter (#15540)Mathias Fußenegger2021-09-01
|/ | | Alternative to https://github.com/neovim/neovim/pull/15224
* docs: make Lua docstrings consistent #15255Gregory Anders2021-08-22
| | | | | | | | | | | | The official developer documentation in in :h dev-lua-doc specifies to use "--@" for special/magic tokens. However, this format is not consistent with EmmyLua notation (used by some Lua language servers) nor with the C version of the magic docstring tokens which use three comment characters. Further, the code base is currently split between usage of "--@", "---@", and "--- @". In an effort to remain consistent, change all Lua magic tokens to use "---@" and update the developer documentation accordingly.
* refactor: remove remaining references to nvim_buf_set_virtual_textGregory Anders2021-08-03
|
* fix(lsp): Add separator between codelens in virttext (#15049)Mathias Fußenegger2021-07-10
| | | | | | | | | | | | Before: Lens1Lens2 After: Lens1 | Lens2 Fixes https://github.com/neovim/neovim/issues/15048
* feat(lsp): Add codelens supportMathias Fussenegger2021-06-14