aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
Commit message (Collapse)AuthorAge
* fix(lua): properly configure luacheck and remove `local vim = ...` lines ↵Folke Lemaitre2022-10-09
| | | | (#20551)
* feat(lsp): support window/showDocument (#19977)lvimuser2022-10-08
|
* docs: fix typos (#20394)dundargoc2022-09-30
| | | | | Co-authored-by: Raphael <glephunter@gmail.com> Co-authored-by: smjonas <jonas.strittmatter@gmx.de> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* feat(gen_help_html.lua): adapt to new parserJustin M. Keyes2022-09-28
| | | | | - adapt to parser changes from https://github.com/vigoux/tree-sitter-vimdoc/pull/16 - numerous other generator improvements
* fix(docs): invalid :help links #20345Justin M. Keyes2022-09-25
| | | | | Fix those naughty single quotes. closes #20159
* fix(lsp): create missing directory before creating file (#19835)shaunsingh2022-09-24
| | | Co-authored-by: Mathias Fussenegger <f.mathias@zignar.net>
* fix(lsp): out of bounds error in lsp.util.apply_text_edits (#20137)ofwinterpassed2022-09-20
| | | Co-authored-by: Jonas Strittmatter <40792180+smjonas@users.noreply.github.com>
* fix(lsp): set end_col in formatexpr (#19676)Mathias Fußenegger2022-08-08
| | | | The last line was excluded from formatting via formatexpr because the character in the params was set to 0 instead of the end of line.
* fix(lsp): avoid ^M character in hover window on Windows (#19640)Cai.MY2022-08-05
|
* feat(lsp): add range option to code_action; deprecate range_code_action (#19551)Mathias Fußenegger2022-07-28
| | | | | | | | | | | | | | | `code_action` gained extra functions (`filter` and `apply`) which `range_code_action` didn't have. To close this gap, this adds a `range` option to `code_action` and deprecates `range_code_action`. The option defaults to the current selection if in visual mode. This allows users to setup a mapping like `vim.keymap.set({'v', 'n'}, '<a-CR>', vim.lsp.buf.code_action)` `range_code_action` used to use the `<` and `>` markers to get the _last_ selection which required using a `<Esc><Cmd>lua vim.lsp.buf.range_code_action()<CR>` (note the `<ESC>`) mapping.
* fix: add group in autocmd api #19412Raphael2022-07-17
| | | | regression from PR #19283: custom close autocommands for the preview window were not cleaned up after the window was closed.
* refactor: use `local api = vim.api`ii142022-07-15
|
* refactor(lsp): make the use of local aliases more consistentii142022-07-15
|
* fix(lsp): pcall nvim_del_augroup_by_name (#19302)Christian Clason2022-07-10
| | | fixup for #19283
* refactor: remove functions marked for deprecation in 0.8 (#19299)Gregory Anders2022-07-09
|
* refactor(lua): replace vim.cmd use with API calls (#19283)Raphael2022-07-09
| | | Signed-off-by: Raphael <glephunter@gmail.com>
* refactor(lua): reformat with stylua 0.14.0 (#19264)Christian Clason2022-07-07
| | | | * reformat Lua runtime to make lint CI pass * reduce max line length to 100
* fix(lsp): set buflisted before switching to buffer (#18854)zeertzjq2022-06-04
|
* fix(lsp): respect global syntax setting in open float preview (#15225)Elton Leander Pinto2022-05-25
|
* refactor: add warnings for deprecated functions (#18662)dundargoc2022-05-21
|
* feat(lsp): option to reuse_win for jump actions (#18577)Lewis Russell2022-05-18
|
* chore: format runtime with styluaChristian Clason2022-05-09
|
* docs: change wrap_at type to number (#18456)Noval Maulana2022-05-07
|
* fix(lsp): add missing bufnr argument (#18382)Jose Alvarez2022-05-03
|
* feat(lsp): add vim.lsp.buf.format (#18193)Michael Lingelbach2022-04-30
|
* fix(lsp): unify progress message handling (#18040)runiq2022-04-20
| | | | | | | | | | | The LSP progress handler would put non-progress messages (such as from clangd or pyls; not part of the LSP spec) directly into `client.messages`, while `vim.lsp.util.get_progress_messages()` would try to fetch them from `client.messages.messages` instead (and come up empty everytime). This would result in these messages never being cleaned up by `get_progress_messages()`. This commit fixes that by treating those messages like show-once progress messages (by setting `done=true` immediately).
* fix(lsp): fix lookup of boolean values in workspace/configuration (#18026)Fredrik Ekre2022-04-15
|
* docs(lsp): remove outdated offset_encoding default value for apply_text_editsAndrea Cappuccio2022-03-30
|
* fix(lsp): use "text" filetype for plaintext (#17898)Jaehwang Jung2022-03-28
|
* fix(lsp): set tabSize from 'shiftwidth', not 'softtabstop' (#17787)Tim Pope2022-03-20
| | | | | | | | | The use of 'softtabstop' to set tabSize was introduced in 5d5b068, replacing 'tabstop'. If we look past the name tabSize and at the actual purpose of the field, it's the indentation width used when formatting. This corresponds to the Vim option 'shiftwidth', not 'softtabstop'. The latter has the comparatively mundane purpose of controlling what happens when you hit the tab key (and even this is incomplete, as it fails to account for 'smarttab').
* fix(lsp): respect all of 'fixeol', 'eol', and 'binary' applying edits (#17574)Tim Pope2022-03-02
|
* refactor(highlight)!: optional arguments for highlight.range as table (#17462)Christian Clason2022-02-21
| | | | | | | | | also update documentation BREAKING CHANGE: signature of highlight.range is now vim.highlight.range(bufnr, ns, hlgroup, start, finish, { regtype = regtype, inclusive = inclusive, priority = priority }) Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com>
* fix: lsp and diagnostic highlight priority (#17461)Michael Lingelbach2022-02-19
| | | | | | | | | Closes https://github.com/neovim/neovim/issues/17456 * treesitter uses the default highlight priority of 50 * diagnostic highlights have a priority of 150 * lsp reference highlights have a priority of 200 This ensures proper ordering.
* feat: use nvim_buf_set_extmark for vim.highlight (#16963)Michael Lingelbach2022-01-15
| | | | | | | | | Closes https://github.com/neovim/neovim/issues/13647 This allows customizing the priority of the highlights. * Add default priority of 50 * Use priority of 200 for highlight on yank * use priority of 40 for highlight references (LSP)
* fix(lsp): always split text edits on \r, \r\n, and \n (#17087)Michael Lingelbach2022-01-14
| | | | | | | | | | Closes: https://github.com/neovim/neovim/issues/17053 Servers can return a mix of line endings per the language server protocol. See: https://microsoft.github.io/language-server-protocol/specification.html#textDocuments All should be equally treated as line endings.
* fix(lsp): forward offset_encoding in rename handler (#17079)Michael Lingelbach2022-01-13
|
* fix(lsp): forward offset_encoding to apply_text_edits (#17075)Michael Lingelbach2022-01-13
|
* fix(lsp): strictly enforce passing offset encoding (#17049)Michael Lingelbach2022-01-13
| | | | | | | | | | This removes the "fallback" to utf-16 in many of our helper functions. We should always explicitly pass these around when possible except in two locations: * generating params with help utilities called by buf.lua functions * the buf.lua functions themselves Anything that is called by the handler should be passed the offset encoding.
* fix(lsp): handle negative activeSignature in signatureHelp (#17064)Mathias Fußenegger2022-01-13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | omnisharp-roslyn can send negative values: { activeParameter = 0, activeSignature = -1, signatures = { { documentation = "", label = "TestEntity.TestEntity()", parameters = {} } } } In 3.16 of the specification `activeSignature` is defined as `uinteger` and therefore negative values shouldn't be allowed, but within 3.15 it was defined as `number` which makes me think we can be a bit lenient in this case and handle them. The expected behavior is quite clear: The active signature. If omitted or the value lies outside the range of `signatures` the value defaults to zero or is ignored if the `SignatureHelp` has no signatures. Fixes an error: util.lua:1685: attempt to get length of local 'lines' (a nil value) util.lua:1685: in function 'trim_empty_lines' handlers.lua:334: in function 'textDocument/signatureHelp'
* fix(lsp): fix applying multiple out-of-range TextEdits (#17037)hrsh7th2022-01-13
|
* fix(lsp): resolve bufnr for get_lines (#16986)Michael Lingelbach2022-01-08
| | | | | | | Closes https://github.com/neovim/neovim/issues/16985 * get_lines checks if buf_loaded using bufnr 0, which is typically used as a sentinel value, but here must be resolved to the true bufnr
* feat(lua): add notify_once() (#16956)Gregory Anders2022-01-06
| | | Like vim.notify(), but only displays the notification once.
* fix(lsp): resolve nil bufnr (#16902)Gregory Anders2022-01-03
| | | Related: #16889, #16745
* fix: resolve nil arguments to API functions (#16889)Gregory Anders2022-01-03
| | | | | | As revealed by #16745, some functions pass a nil value to API functions, which have been implicitly converted to 0. #16745 breaks this implicit conversion, so explicitly pass a resolved buffer number to these API functions.
* fix(lsp): always use target bufnr in location handler (#16876)Michael Lingelbach2022-01-02
|
* fix(lsp): fix `nil`-index behavior for UTF-8 in `_str_*index_enc` methods ↵Rishikesh Vaishnav2021-12-20
| | | | | (#16731) Previously, the `_str_utfindex_enc` and `_str_byteindex_enc` helper functions would return `nil` when `offset_encoding == "utf-8"` and `index == nil`. Clearly, this doesn't reflect the expected behavior of the functions they're wrapping which would return the length of the line in this case. This should fix behavior with servers that use UTF-8 `offset_encoding` when applying text edits, formatting a range, and doing range code actions (though this isn't tested currently).
* fix(ui): close floating window on BufLeave event (#16557)ii142021-12-15
| | | | | | | | | When buffer is visible in two splits simultaneously, BufHidden event is not triggered, causing the floating window to remain on screen after switching to another buffer. Remove BufHidden event from close_events defaults, and close the window if we changed the buffer to something other than the buffer that spawned the floating window or the floating window buffer itself.
* fix(lsp): create lsp requests with position offsets considering client ↵Rishikesh Vaishnav2021-12-10
| | | | | | encoding (#16382) Co-authored-by: black-desk <clx814727823@gmail.com> Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
* refactor(diagnostic): add warning to deprecated functions (#16536)dundargoc2021-12-08
|
* feat(lsp,diagnostic): open folds in jump-related functions (#16520)Dmytro Meleshko2021-12-04
|