aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
...
* 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(filetype): fix foam pattern detectionGregory Anders2022-01-13
|
* feat(filetype.lua): fix .cc file not detectedrhcher2022-01-13
|
* feat(filetype.lua): add support for files under .gitSanchayan Maity2022-01-13
|
* feat(filetype.lua): add support for patch filesSanchayan Maity2022-01-13
|
* feat(filetype.lua): add support for tmux.conf filesGary Sentosa2022-01-13
|
* feat(filetype.lua): fix .env file not detectedGary Sentosa2022-01-13
|
* vim-patch:8.2.4077: not all Libsensors files are recognized (#17080)Christian Clason2022-01-13
| | | | | Problem: Not all Libsensors files are recognized. Solution: Add "sensors.d/*" pattern. (Doug Kearns) https://github.com/vim/vim/commit/8d9e470aa91a93da7d6bda62521aef69a79e956d
* 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
|
* Merge pull request #16945 from theHamsta/cached-queriesThomas Vigouroux2022-01-13
|\ | | | | perf(treesitter): cache query parsing
| * perf(treesitter): cache query parsingStephan Seitz2022-01-06
| |
* | feat(diagnostic): allow retrieving current diagnostic configGregory Anders2022-01-11
| |
* | fix(diagnostic): only set default handler config if unsetGregory Anders2022-01-11
| |
* | fix(diagnostic): allow setting arbitrary config valuesGregory Anders2022-01-11
| |
* | fix(diagnostic): resolve nil opts tablesGregory Anders2022-01-11
| | | | | | | | | | In functions which allow opts to be optional, ensure that the value actually resolves to a non-nil value.
* | vim-patch:8.2.4064: foam files are not detected (#17041)Christian Clason2022-01-11
| | | | | | | | | | | | | | | | | | | | | | | | * vim-patch:8.2.4064: foam files are not detected Problem: Foam files are not detected. Solution: Detect the foam filetype by the path and file contents. (Mohammed Elwardi Fadeli, closes vim/vim#9501) https://github.com/vim/vim/commit/2284f6cca384e0ccc352bfec7277dc26386cac3d * Port foam ft detection to filetype.lua Co-authored-by: Gregory Anders <greg@gpanders.com>
* | refactor(lsp): debounce timer per buf and unify with non-debounce (#17016)Mathias Fußenegger2022-01-11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Part of the `pending_change` closure in the `changetracking.prepare` was a bit confusing because it has access to `bufnr` and `uri` but it could actually contain pending changes batched for multiple buffers. (We accounted for that by grouping `pending_changes` by a `uri`, but it's not obvious what's going on) This commit changes the approach to do everything per buffer to avoid any ambiguity. It also brings the debounce/no-debounce a bit closer together: The only difference is now whether a timer is used or if it is triggered immediately
* | fix(lsp): ensure pending changes are flushed on skipped debounce (#17015)Mathias Fußenegger2022-01-10
| | | | | | | | | | | | | | | | | | Follow up to https://github.com/neovim/neovim/pull/16881 Document changes could get sent out of order to the server: 1. on_lines: debounce > 0; add to pending changes; setup timer 2. on_lines: debounce = 0; send new changes immediately 3. timer triggers, sending changes from 1.
* | fix(lsp): only send valid params in executeCommand (#16987)Michael Lingelbach2022-01-08
| |
* | 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
* | fix(filetype): match negative priority patterns after extensions (#16980)Gregory Anders2022-01-07
| | | | | | | | | | Negative priority patterns are those that act as catch-alls when all other attempts at matching have failed (typically the patterns that use the StarSetf functions).
* | feat(lsp): skip or reduce debounce after idle (#16881)Mathias Fußenegger2022-01-07
| | | | | | | | | | | | | | | | | | | | The idea of the debounce is to avoid overloading a server with didChange notifications. So far this used a constant value to group changes within an interval together and send a single notification. A side effect of this is that when you were idle, notifications are still delayed. This commit changes the logic to take the time the last notification happened into consideration, if it has been greater than the debounce interval, the debouncing is skipped or at least reduced.
* | vim-patch:8.2.4014: git and gitcommit file types not properly recognized ↵Christian Clason2022-01-07
| | | | | | | | | | | | | | (#16953) Problem: Git and gitcommit file types not properly recognized. Solution: Adjust filetype detection. (Tim Pope, closes vim/vim#9477) https://github.com/vim/vim/commit/c689f8c3d98fffe7e13730e198ce120934528f9c
* | feat(lua): add notify_once() (#16956)Gregory Anders2022-01-06
| | | | | | Like vim.notify(), but only displays the notification once.
* | Merge pull request #16591 from shadmansaleh/feat/lua_keymaps2Björn Linse2022-01-06
|\ \ | |/ |/| feat(lua): add support for lua keymaps
| * feat(lua): add vim.keymapshadmansaleh2022-01-04
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This introduces two new functions `vim.keymap.set` & `vim.keymap.del` differences compared to regular set_keymap: - remap is used as opposite of noremap. By default it's true for <Plug> keymaps and false for others. - rhs can be lua function. - mode can be a list of modes. - replace_keycodes option for lua function expr maps. (Default: true) - handles buffer specific keymaps Examples: ```lua vim.keymap.set('n', 'asdf', function() print("real lua function") end) vim.keymap.set({'n', 'v'}, '<leader>lr', vim.lsp.buf.references, {buffer=true}) vim.keymap.set('n', '<leader>w', "<cmd>w<cr>", {silent = true, buffer = 5 }) vim.keymap.set('i', '<Tab>', function() return vim.fn.pumvisible() == 1 and "<C-n>" or "<Tab>" end, {expr = true}) vim.keymap.set('n', '[%', '<Plug>(MatchitNormalMultiBackward)') vim.keymap.del('n', 'asdf') vim.keymap.del({'n', 'i', 'v'}, '<leader>w', {buffer = 5 }) ```
* | fix(filetype): normalize slashes in file pathsGregory Anders2022-01-05
| |
* | test(filetype): port test_filetype to LuaGregory Anders2022-01-05
| | | | | | | | | | | | | | | | | | | | Because filetype.lua is gated behind an opt-in variable, it's not tested during the "standard" test_filetype.vim test. So port the test into filetype_spec where we enable the opt-in variable. This means runtime Vim patches will need to update test_filetype in two places. This can eventually be removed if/when filetype.lua is made opt-out rather than opt-in.
* | fix(filetype): match on <afile> rather than <abuf> (#16943)Gregory Anders2022-01-05
| | | | | | | | | | | | | | Filetype detection runs on BufRead and BufNewFile autocommands, both of which can fire without an underlying buffer, so it's incorrect to use <abuf> to determine the file path. Instead, match on <afile> and assume that the buffer we're operating on is the current buffer. This is the same assumption that filetype.vim makes, so it should be safe.
* | feat(lsp): enable default debounce of 150 ms (#16908)Michael Lingelbach2022-01-05
| |
* | feat(filetype.lua): add support for txt files (#16926)KillTheMule2022-01-04
| |
* | chore: ignore unused args in filetype functions (#16927)Gregory Anders2022-01-04
| | | | | | Also mark the 'getline' helper function as private to avoid docgen.
* | feat(filetype.lua): Add typescript extension to filetype detection (#16923)Robin Gagnon2022-01-04
| | | | | | port from `filetype.vim`; also add `getline` convenience function
* | chore: fix typos (#16816)dundargoc2022-01-04
| | | | | | | | | | | | | | Co-authored-by: Sean Dewar <seandewar@users.noreply.github.com> Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Sebastian Volland <seb@baunz.net> Co-authored-by: Lewis Russell <lewis6991@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com>
* | fix(lsp): suppress ContentModified errors from UI (#16904)Sam McCall2022-01-04
|/ | | | | | | | | Fixes https://github.com/neovim/neovim/issues/16900 If clients receive a ContentModified error, it generally should not show it in the UI for the end-user. Clients can resend the request if they know how to do so. https://microsoft.github.io/language-server-protocol/specifications/specification-current/#implementationConsiderations
* feat: filetype.lua (#16600)Gregory Anders2022-01-04
| | | | Adds a new vim.filetype module that provides support for filetype detection in Lua.
* fix(lsp): explicitly pass bufnr in didSave handler (#16906)Michael Lingelbach2022-01-03
| | | | Addresses a regression introduced by the stricter type checking in lua api functions from https://github.com/neovim/neovim/pull/16745
* 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(diagnostic): improve validation for list arguments (#16855)Gregory Anders2022-01-01
| | | | | | Function arguments that expect a list should explicitly use tbl_islist rather than just checking for a table. This helps catch some simple errors where a single table item is passed as an argument, which passes validation (since it's a table), but causes other errors later on.
* feat(lua): add support for multiple optional types in vim.validate (#16864)Shadman2022-01-01
|
* chore: fix typos (#16506)dundargoc2021-12-28
| | | | | | | | | Co-authored-by: Gregory Anders <8965202+gpanders@users.noreply.github.com> Co-authored-by: Evgeni Chasnovski <evgeni.chasnovski@gmail.com> Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Christoph Hasse <hassec@users.noreply.github.com> Co-authored-by: Alef Pereira <ealefpereira@gmail.com> Co-authored-by: AusCyber <willp@outlook.com.au> Co-authored-by: kylo252 <59826753+kylo252@users.noreply.github.com>
* fix(uri): change scheme pattern to not include the comma character (#16797)Dmytro Meleshko2021-12-26
|
* feat(lsp): add buf_detach_client (#16250)Michael Lingelbach2021-12-21
| | | | | This allows the user to detach an active buffer from the language client. If no clients remain attached to a buffer, the on_lines callback is used to cancel nvim_buf_attach.
* 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).