aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim/lsp/util.lua
Commit message (Collapse)AuthorAge
...
* lsp: add $/progress report (#13294)Matthieu Coudron2020-12-20
| | | | Heavily inspired by https://github.com/nvim-lua/lsp-status.nvim. listen to the LspProgressUpdate event to update your statusline.
* doc: Fix incorrect LSP diagnostic-related helptags (#13388)Kevin Fleming2020-12-09
|
* feat: Allow incremental sync & lsp flags (#13371)TJ DeVries2020-12-08
|
* lsp: Make open_floating_preview buffers ephemeral (#13437)runiq2020-12-03
| | | Fixes #13429.
* LSP: Feature/add workspace folders (#12638)Michael Lingelbach2020-11-25
| | | | | | | | | | | * First implementation of workspace folders * Add completion for current directory * Add tracking of workspace folders * Add workspace folder listing * Add checks on adding/removing workspaces * Add appropriate initialization options * Add documentation * Make workspaceFolders available wherever client is
* lsp: vim.lsp.diagnostic (#12655)TJ DeVries2020-11-12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Breaking Changes: - Deprecated all `vim.lsp.util.{*diagnostics*}()` functions. - Instead, all functions must be found in vim.lsp.diagnostic - For now, they issue a warning ONCE per neovim session. In a "little while" we will remove them completely. - `vim.lsp.callbacks` has moved to `vim.lsp.handlers`. - For a "little while" we will just redirect `vim.lsp.callbacks` to `vim.lsp.handlers`. However, we will remove this at some point, so it is recommended that you change all of your references to `callbacks` into `handlers`. - This also means that for functions like |vim.lsp.start_client()| and similar, keyword style arguments have moved from "callbacks" to "handlers". Once again, these are currently being forward, but will cease to be forwarded in a "little while". - Changed the highlight groups for LspDiagnostic highlight as they were inconsistently named. - For more information, see |lsp-highlight-diagnostics| - Changed the sign group names as well, to be consistent with |lsp-highlight-diagnostics| General Enhancements: - Rewrote much of the getting started help document for lsp. It also provides a much nicer configuration strategy, so as to not recommend globally overwriting builtin neovim mappings. LSP Enhancements: - Introduced the concept of |lsp-handlers| which will allow much better customization for users without having to copy & paste entire files / functions / etc. Diagnostic Enhancements: - "goto next diagnostic" |vim.lsp.diagnostic.goto_next()| - "goto prev diagnostic" |vim.lsp.diagnostic.goto_prev()| - For each of the gotos, auto open diagnostics is available as a configuration option - Configurable diagnostic handling: - See |vim.lsp.diagnostic.on_publish_diagnostics()| - Delay display until after insert mode - Configure signs - Configure virtual text - Configure underline - Set the location list with the buffers diagnostics. - See |vim.lsp.diagnostic.set_loclist()| - Better performance for getting counts and line diagnostics - They are now cached on save, to enhance lookups. - Particularly useful for checking in statusline, etc. - Actual testing :) - See ./test/functional/plugin/lsp/diagnostic_spec.lua - Added `guisp` for underline highlighting NOTE: "a little while" means enough time to feel like most plugins and plugin authors have had a chance to refactor their code to use the updated calls. Then we will remove them completely. There is no need to keep them, because we don't have any released version of neovim that exposes these APIs. I'm trying to be nice to people following HEAD :) Co-authored: [Twitch Chat 2020](https://twitch.tv/teej_dv)
* lsp: remove vim.NIL from processing (#13174)TJ DeVries2020-11-02
| | | | | * lsp: remove vim.NIL from processing * lsp: remove instances of vim.NIL
* lsp: Fix case where active_signature == vim.NIL (#13114)Michael Lingelbach2020-10-27
|
* Opts.wrap_at is sometimes a bool, ensure it falls back to a valid number in ↵Tony Kuneck2020-10-04
| | | | the call to math.min
* LSP: Fix separator width on hover (fixes #13006, #12998) (#13007)Christian Clason2020-09-30
| | | | * fix insert_separator conditional * only draw separator over wrapped width
* lsp: Add vim.lsp.buf.range_code_action() (#12962)notomo2020-09-24
| | | | | Allows to execute code_action for a given range. :'<,'>lua vim.lsp.buf.range_code_action()
* lsp: fix failed switch window error (#12900)Raphael2020-09-14
| | | | | * fix failed switch window error * checks if window already exists
* lsp: Fix parameter markdown rendering for signature help (#12832)Xuyuan Pang2020-09-12
|
* lsp/make_position_param(): handle empty buffer #12825Gıyaseddin Tanrıkulu2020-09-01
| | | | | | | | | | | Fix #12623 problem: nvim_buf_get_lines(0) returns empty during startup, where no buffers are loaded yet. solution: return empty object Happens during startup, where buffer may not be loaded yet, because... `source_startup_scripts()` is done before `edit_buffers()`: https://github.com/neovim/neovim/blob/9bb552875d205d2f869c66137563f93b77a6d08e/src/nvim/main.c#L362 https://github.com/neovim/neovim/blob/9bb552875d205d2f869c66137563f93b77a6d08e/src/nvim/main.c#L480
* lsp: Fix bad sortText comparison (#12485)Anmol Sethi2020-08-30
| | | | | | The spec indicates we have to fallback to comparing by label if sortText is falsy. Closes #12431
* Add FIXMEsPatrice Peterson2020-08-23
|
* Add docs for most vim.lsp methodsPatrice Peterson2020-08-23
| | | | Most of the lsp.log will be addressed in a separate PR.
* Remove unused function (#12719)Patrice Peterson2020-08-08
|
* Revert "lsp: Fix text edits with the same start position (#12434)" (#12564)Andreas Johansson2020-07-30
| | | This reverts commit 44fe8828f06a22bc9aa3617a6fd8aae447a838de.
* Make the window `nomodifiable` when it's createdCédric Barreteau2020-07-20
|
* LSP: make the hover window nomodifiableCédric Barreteau2020-07-20
|
* lsp: add optional vertical padding, maximal size to floats (#12444)Christian Clason2020-07-05
| | | | | | | | | | | * add vertical padding to floats * add max_width, max_height option to float methods * lint * lintlint * guard against nil wrap_at
* doc: fix scripts and regenerate (#12506)TJ DeVries2020-07-02
| | | | | | | | | | | | | | | | | * Fix some small doc issues * doc: fixup * doc: fixup * Fix lint and rebase * Remove bad advice * Ugh, stupid mpack files... * Don't let people include these for now until they specifically want to * Prevent duplicate tag
* lsp: Use nvim_buf_get_lines in locations_to_items and add more tests (#12357)Mathias Fußenegger2020-06-30
| | | | | | | | | | | | | | | * LSP: Add tests & use nvim_buf_get_lines in locations_to_items This is to add support for cases where the server returns a URI in the locations that does not have a file scheme but needs to be loaded via a BufReadCmd event. * LSP: Don't iterate through all lines in locations_to_items * fixup! LSP: Don't iterate through all lines in locations_to_items * fixup! fixup! LSP: Don't iterate through all lines in locations_to_items * fixup! fixup! fixup! LSP: Don't iterate through all lines in locations_to_items
* Merge pull request #12252 from dlukes/formatting-syncHirokazu Hata2020-06-27
|\
| * lsp: Add sync variant of LSP formattingDavid Lukes2020-06-22
| | | | | | | | | | Also, factor out a `vim.lsp.util.get_effective_tabstop()` helper and add tests for it.
* | lsp: when apply text edits, set buflisted on buffers (#12489)francisco souza2020-06-23
|/ | | | | | | | | | | The client creates buffers on the fly to be able to apply text edits on files that weren't previously open, which is great, but it uses the bufadd() function, which creates unlisted buffers and can lead to a weird experience in the text editor. Setting the buffer to buflisted fixes this. Closes #12488. Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
* lsp: Add new highlight groups used in show_line_diagnostics (#12473)francisco souza2020-06-18
| | | | | | | | | * lsp: support custom hl groups in show_line_diagnostics Closes #12472. * runtime: add docs for the new lsp highlight groups Co-authored-by: francisco souza <fsouza@users.noreply.github.com>
* lsp: Fix text edits with the same start position (#12434)Andreas Johansson2020-06-14
| | | | | | | | | | According to the LSP spec[1], multiple edits can have the same starting position, and if that is the case, they should be applied in the order as they come in the array. The implementation uses a reverse sort to not interfere with non applied edits, but failed to take into account the spec. [1] https://microsoft.github.io/language-server-protocol/specifications/specification-3-14/#textedit
* lsp: Add `BufLeave` to `close_preview_autocmd` function call (#12477)Dheepak Krishnamurthy2020-06-12
| | | else popup window remains open when switching buffer.
* lsp: compute height of floating preview correctly for wrapped lines (#12380)Christian Clason2020-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | * take wrapping into account when computing float height * factor out size calculation * add test * accept and pass through opts.wrap_at in floating_preview * make padding configurable * slightly refactor fancy_floating_markdown to make use of make_position * padding using string.format * move trim and pad to separate function * nit Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com> * remove mention of backward compat * make lint happy Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
* Merge pull request #12343 from ndreas/fix/lsp-multibyte-indexingHirokazu Hata2020-06-04
|\ | | | | Fix LSP multibyte indexing
| * Use get_line_byte_from_position in jump_to_locationAndreas Johansson2020-05-19
| |
| * Refactor fetching the line byteAndreas Johansson2020-05-19
| | | | | | | | Takes the entire LSP position instead of line/col
* | lua: add vim.highlight.range (#12401)Christian Clason2020-05-31
| |
* | lua: simple snippet support in the completion items (#12118)Viktor Kojouharov2020-05-28
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Old behavior is: foo(${placeholder: bar, ...) with lots of random garbage you'd never want inserted. New behavior is: foo(bar, baz) (which maybe is good, maybe is bad [depends on user], but definitely better than it was). ----- * Implement rudimentary snippet parsing Add support for parsing and discarding snippet tokens from the completion items. Fixes #11982 * Enable snippet support * Functional tests for snippet parsing Add simplified real-world snippet text examples to the completion items test * Add a test for nested snippet tokens * Remove TODO comment * Return the unmodified item if the format is plain text * Add a plain text completion item
* | lsp: add preview_location util function (#12368)Christian Clason2020-05-26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add preview_location * add doc stub * doc style; return bufnr&winnr of preview * doc: function may return nil Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com> * doc: fixup Co-authored-by: Hirokazu Hata <h.hata.ai.t@gmail.com>
* | lsp: fix get diagnositcsMike Hartington2020-05-19
|/
* lsp: Handle end lines in apply_text_edits (#12314)Andreas Johansson2020-05-17
| | | | | | If the LSP sends an end line that is larger than what nvim considers to be the last line, you get an Index out of bounds error when fetching the line from nvim, a change that was introduced in #12223. This change removes the strict indexing and checks the return value from nvim_buf_get_lines.
* LSP: Add textDocument/codeAction support (#11607)Jesse2020-05-16
| | | | | | | | | | | | * Add textDocument/codeAction * Add callback for workspace/executeCommand * Escape newlines in codeAction titles * Return empty list in get_line_diagnostics if no buffer diagnostics * Add stub documentation * Validate context parameter in code_action * Add support for edit in CodeAction responses * Group diagnostics by line in vim.lsp.util.get_line_diagnostics() * Advertise code action literal support
* lsp: fix bug when documentEdit version=null for unattached buffer (#12272)landerlo2020-05-13
|
* lsp: Make apply_text_edits non-ASCII safe (#12223)Christian Clason2020-05-08
| | | | | | | | | | | | | | | * Make apply_text_edits non-ASCII safe Use `vim.str_byteindex` to correct starting and ending positions for text edits if the line contains non-ASCII characters. Fixes #12221 * text_edit may be applied to other buffers * make sure the buffer is loaded * add comments * add test for non-ASCII edits
* lsp: Handle unknown CompletionItemKind and SymbolKind (#12257)Hirokazu Hata2020-05-07
| | | | | | | | | | | * lsp: handle kinds not specified in protocol fix: #12200 If the client set "symbolKind.valueSet", the client must handle it properly even if it receives a value outside the specification. * test: add lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} test case * lsp: make lsp.util.{get_completion_item_kind_name, get_symbol_kind_name} private
* lsp: set buflisted when jumping to location (#12253)Gabriel Sanches2020-05-07
|
* lsp: fix tagstack for location jump #12248Gabriel Sanches2020-05-04
|
* Merge pull request #12237 from h-michael/vim-nilMatthieu Coudron2020-05-04
|\ | | | | lsp: text_document.version may be vim.NIL not nil
| * [LSP] check for vim.NIL and add apply_text_document_edit testsckipp012020-05-01
| |
* | Merge pull request #12228 from h-michael/fix-docsyms-to-itemsMatthieu Coudron2020-05-02
|\ \ | | | | | | lsp: fix lsp.util.symbols_to_items with DocumentSymbol has children
| * | lsp: fix lsp.util.symbols_to_itemsHirokazu Hata2020-05-02
| |/ | | | | | | | | | | | | fix: https://github.com/neovim/neovim/pull/11931#issuecomment-622422581 There was an error in the process of flattening the hierarchical structure. So when DocumentSymbol has children, our client can't handle it correctly.
* / LSP: Support LocationLink (#12231)Christian Clason2020-05-02
|/ | | | * support LocationLink in callbacks * announce linkSupport in client capabilities