aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* treesitter: cache the capture hl relationThomas Vigouroux2020-07-10
|
* treesitter: use change calbacks on redrawThomas Vigouroux2020-07-10
|
* treesitter: call bufload before parsing (#12603)Thomas Vigouroux2020-07-10
|
* lua: add options to highlight.on_yank (#12549)Christian Clason2020-07-05
| | | | | NOTE: Configuration options have changed for highlight.on_yank. Check help for |:help highlight.on_yank()|
* 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 #12491 from vigoux/treesitter-set-rangesMatthieu Coudron2020-06-30
|\ | | | | [RDY] Treesitter set ranges
| * treesitter: use nodes to mark rangesThomas Vigouroux2020-06-29
| |
| * treesitter: add set_included_ranges to the parserThomas Vigouroux2020-06-29
| | | | | | | | This is the first step towards language injection using treesitter.
* | LSP: Set current name as default rename text (#12553)cbarrete2020-06-27
| | | | | | | | | | | | Since we don't know what the server considers to be a symbol, `cword` is the best bet in most cases. Co-authored-by: Cédric Barreteau <>
* | 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>
* Merge pull request #12469 from h-michael/requestHirokazu Hata2020-06-15
|\ | | | | lsp: even if contents before change is 0 byte, request to server
| * lsp: even if contents before change is 0 byte, request to serverHirokazu Hata2020-06-11
| | | | | | | | fix: https://github.com/neovim/neovim/issues/12414
* | 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: Fix #12449 textDocumentSync.save can be boolean. Access ↵Stephan Seitz2020-06-11
|/ | | | textDocumentSync.save.includeText only if table. (#12450)
* Merge pull request #12321 from vigoux/treesitter-runtimeMatthieu Coudron2020-06-06
|\ | | | | treesitter: update runtime
| * treesitter: fix testsThomas Vigouroux2020-06-03
| |
* | lsp: do not process diagnostics for unloaded buffers (#12440)TJ DeVries2020-06-04
| |
* | 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>
* | lsp: Add check for `declaration` and `typeDefinition` support in vim lsp ↵Dheepak Krishnamurthy2020-06-04
| | | | | | | | | | | | | | | | | | | | | | | | | | server before making `request` (#12421) * Add check for typeDefinition support in vim lsp server * Check for typeDefinitionProvider in server * Check for declarationProvider in server * Add check for client support * Fix typo
* | lua: fix behavior when split empty string (#12429)notomo2020-06-04
| | | | | | | | | | * lua: fix behavior when split empty string * test: lsp.util.apply_text_edits with an empty edit
* | 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: fix infinite loop for vim.split on empty string (#12420)notomo2020-06-02
| |/ |/|
* | lua: add vim.highlight.range (#12401)Christian Clason2020-05-31
| |
* | lua: vim.wait implementationTJ DeVries2020-05-30
| |
* | 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: make the command error message more detailed (#11633)Hirokazu Hata2020-05-26
| | | | | | | | | | * lsp.lua: make the error message more detailed * test: add lsp._cmd_part test
* | lsp: change log name to "lsp.log" from "vim-lsp.log"Hirokazu Hata2020-05-23
| | | | | | | | | | It's confusing because vim-lsp already has the same name as the plugin name that predates this built-in lsp. Also, since "vim.fn.stdpath" is used, adding the prefix "nvim-" is redundant, so just "lsp.log" will suffice.
* | Change uri_to_fname to not convert non-file URIs (#12351)Mathias Fußenegger2020-05-22
| | | | | | | | | | | | | | | | | | * Change uri_to_fname to not convert non-file URIs A URI with a scheme other than file doesn't have a local file path. * fixup! Change uri_to_fname to not convert non-file URIs * fixup! fixup! Change uri_to_fname to not convert non-file URIs
* | LSP: Don't swallow bufnr argument from callbacks (#12350)Mathias Fußenegger2020-05-20
| | | | | | | | | | The callbacks for `textDocument/documentSymbol` and `workspace/symbol` never received the `bufnr` argument because the logic that adds error validation and logging swallowed the argument.
* | lsp: fix get diagnositcsMike Hartington2020-05-19
| |
* | lua: Add highlight.on_yank (#12279)Christian Clason2020-05-18
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * add lua function to highlight yanked region * extract namespace, better naming, default values * add default for event argument * free timer * factor out mark to position calculation * d'oh * make sure timer stops before callback (cf. luv example) * factor out timer, more documentation * fixup * validate function argument for schedule * fix block selection past eol * correct handling of multibyte characters * move arguments around, some cleanup * move utility functions to vim.lua * use anonymous namespaces, avoid local api * rename function * add test for schedule_fn * fix indent * turn hl-yank into proper (hightlight) module * factor out position-to-region function mark extraction now part of highlight.on_yank * rename schedule_fn to defer_fn * add test for vim.region * todo: handle double-width characters * remove debug printout * do not shadow arguments * defer also callable table * whitespace change * move highlight to vim/highlight.lua * add documentation * add @return documentation * test: add check before vim.defer fires * doc: fixup
* lsp: Fix timezone format of LSP log (ISO 8601) (#12332)Eisuke Kawashima2020-05-17
|
* 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.
* lua: add tbl_deep_extend (#11969)Hirokazu Hata2020-05-17
|
* Check for nil before checking for empty tableAndy Lindeman2020-05-15
| | | | | | | At least the `gopls` language server seems to return nil/null if no code actions are available. Currently this results in an error: > Error executing vim.schedule lua callback: shared.lua:199: Expected table, got nil
* 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: Add workspace.applyEdit client capabilities (#12313)Mathias Fußenegger2020-05-14
| | | applyEdit is supported by the built-in client.
* lsp: fix bug when documentEdit version=null for unattached buffer (#12272)landerlo2020-05-13
|
* LSP: Make applyEdit return a response (#12270)Mathias Fußenegger2020-05-11
| | | | | | | | According to the specification workspace/applyEdit needs to respond with a `ApplyWorkspaceEditResponse` See https://microsoft.github.io/language-server-protocol/specifications/specification-current/#workspace_applyEdit This is a subset of https://github.com/neovim/neovim/pull/11607
* 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