aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua
Commit message (Collapse)AuthorAge
...
* fix(lsp): handle nil client in onexit callback (#19722)Mathias Fußenegger2022-08-11
| | | Follow up to https://github.com/neovim/neovim/pull/19658
* fix(lsp): avoid pipe leaks if lsp cmd isn't executable (#19717)Mathias Fußenegger2022-08-11
| | | The `onexit` handler isn't called if `uv.spawn` doesn't return a handle.
* fix(lsp): fix some type annotations in lsp.rpc (#19714)Mathias Fußenegger2022-08-11
|
* vim-patch:9.0.0182: quarto files are not recognized (#19702)Jonas Strittmatter2022-08-10
| | | | | | Problem: Quarto files are not recognized. Solution: Recognize quarto files by the extension. (Jonas Strittmatter, closes vim/vim#10880) https://github.com/vim/vim/commit/3a9687fb2749cb3da6e3bbf60cb9eaa81f7889ae
* fix(lsp): handle multiple clients with incremental sync (#19658)Mathias Fußenegger2022-08-09
| | | | | | | | | | | | | | | The change tracking used a single lines/lines_tmp table to track changes to a buffer. If multiple clients using incremental sync are connected to a buffer, they both made changes to the same lines table. That resulted in an inconsistent state. This commit changes the didChange handling to group clients by synchronization scheme and offset encoding. This avoids computing the diff multiple times for clients using the same scheme and resolves the lines/lines_tmp conflicts. Fixes https://github.com/neovim/neovim/issues/19325
* vim-patch:partial: 48c3f4e0bff7 (#19684)Christian Clason2022-08-09
| | | | | | | | vim-patch:partial:48c3f4e0bff7 Update runtime files https://github.com/vim/vim/commit/48c3f4e0bff7efd289a7001b68c777b6f89a7057 partially skip `options.txt` (needs 9.0.0138)
* docs(lua): add Lua 5.1 reference manual (#19663)dundargoc2022-08-08
| | | | | | | | based on http://www.vim.org/scripts/script.php?script_id=1291 reformatted to match Nvim documentation style; removed irrelevant sections Co-authored-by: dundargoc <gocundar@gmail.com> Co-authored-by: Christian Clason <c.clason@uni-graz.at> Co-authored-by: Lewis Russell <lewis6991@gmail.com>
* feat(lsp): set formatexpr by default (#19677)Mathias Fußenegger2022-08-08
| | | Follow up to https://github.com/neovim/neovim/pull/19003
* 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.
* feat(lsp): disable exit_timeout by default (#19672)Mathias Fußenegger2022-08-08
| | | | | | | | | | | | | | | | | The lsp client used to wait up to 500ms for a language server to shutdown before sending a TERM signal. The intention behind the 500ms grace period was to ensure the language server exits to prevent stale processes, but it has the side-effect that it can interrupt language-servers which are too slow to shutdown within 500ms. Language servers tend to write out index files or project files on shutdown, and being interrupted during this process can cause corruption of those files. This changes the default to not wait at all, at the risk of leaving stale processes around if the language server isn't well behaved. An alternative would be to wait indefinitely, but that can cause neovim to take several seconds to exit.
* fix(lsp): avoid ^M character in hover window on Windows (#19640)Cai.MY2022-08-05
|
* fix(lsp): prevent unexpected position jumps (#19370)rhcher2022-08-03
|
* docs: fix typos (#19588)dundargoc2022-08-03
| | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: notomo <notomo.motono@gmail.com>
* test: improve mapping tests and docs (#19619)zeertzjq2022-08-02
|
* fix(lsp): send didOpen if name changes on write (#19583)Mathias Fußenegger2022-08-01
| | | | | | | | | `:saveas newName` changes the name of an existing buffer. Due to the buffer re-use it skips the lsp attach phase and immediately sends a `didSave` notification to the server. Servers get confused about this, because they expect a `didOpen` notification first. Closes https://github.com/neovim/neovim/issues/18688
* feat(api): add replace_keycodes to nvim_set_keymap (#19598)ii142022-08-01
|
* Use Strings instead of Tables in vim.filetype.matchregex Doc (#19604)LaurenceWarne2022-08-01
| | | docs: use strings instead of tables in vim.filetype.matchregex doc
* docs: fix typos (#19024)dundargoc2022-07-31
| | | | Co-authored-by: zeertzjq <zeertzjq@outlook.com> Co-authored-by: Valery Viktorovsky <viktorovsky@gmail.com>
* docs(lsp): use direct link to formattingOptions in format docs (#19558)Mathias Fußenegger2022-07-28
| | | | Also changes `@see` to `See` to avoid the break to a dedicated "See also" block in the generated vimdoc
* 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.
* feat(lsp): provide feedback if server can't compute rename result (#19546)Mathias Fußenegger2022-07-27
| | | | | Without some form of feedback a user cannot easily tell if the server is still computing the result (which can take a while in large projects), or whether the server couldn't compute the rename result.
* fix(lsp): set workspace.configuration capability (#19548)Mathias Fußenegger2022-07-27
| | | | | | | | | | | | | Neovim implements `workspace/configuration` It should set the capability accordingly. From https://microsoft.github.io/language-server-protocol/specifications/lsp/3.17/specification/#clientCapabilities: /** * The client supports `workspace/configuration` requests. * * @since 3.6.0 */ configuration?: boolean;
* vim-patch:9.0.0093: sway config files are recognized as i3config (#19545)Christian Clason2022-07-27
| | | | | Problem: Sway config files are recognized as i3config. Solution: Recognize swayconfig separately. (James Eapen, closes vim/vim#10672) https://github.com/vim/vim/commit/7abd1c6d8e777bde1700633bafc1a40be9e9c1aa
* vim-patch:9.0.0088: pattern for detecting bitbake files is not sufficient ↵Gregory Anders2022-07-27
| | | | | | | (#19547) Problem: Pattern for detecting bitbake files is not sufficient. Solution: Adjust the pattern. (Gregory Anders, closes vim/vim#10743) https://github.com/vim/vim/commit/30e212dac1d29536883c36918a465a38d81d6413
* vim-patch:9.0.0084: using "terraform" filetype for .tfvars file is bad (#19526)Christian Clason2022-07-26
| | | | | | Problem: Using "terraform" filetype for .tfvars file is bad. Solution: use "terraform-vars", so that different completion and other mechanisms can be used. (Radek Simko, closes vim/vim#10755) https://github.com/vim/vim/commit/15b87b6610bfce0c6296bbbad019c944f88a74ca
* vim-patch:9.0.0073: too many files recognized as bsdl (#19504)Christian Clason2022-07-26
| | | | | | Problem: Too many files recognized as bsdl. Solution: Use pattern "*.bsd" instead of "*bsd". (Martin Tournoij, closes vim/vim#10783) https://github.com/vim/vim/commit/1b67f07f7626b87d9ce3e16815970988983a2ddc
* feat(lsp): allow passing custom list handler to LSP functions that return ↵Dalius Dobravolskas2022-07-25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | lists (#19213) Currently LSP allows only using loclist or quickfix list window. I normally prefer to review all quickfix items without opening quickfix window. This fix allows passing `on_list` option which allows full control what to do with list. Here is example how to use it with quick fix list: ```lua local function on_list(options) vim.fn.setqflist({}, ' ', options) vim.api.nvim_command('cfirst') end local bufopts = { noremap=true, silent=true, buffer=bufnr } vim.keymap.set('n', '<leader>ad', function() vim.lsp.buf.declaration{on_list=on_list} end, bufopts) vim.keymap.set('n', '<leader>d', function() vim.lsp.buf.definition{on_list=on_list} end, bufopts) vim.keymap.set('n', '<leader>ai', function() vim.lsp.buf.implementation{on_list=on_list} end, bufopts) vim.keymap.set('n', '<leader>at', function() vim.lsp.buf.type_definition{on_list=on_list} end, bufopts) vim.keymap.set('n', '<leader>af', function() vim.lsp.buf.references(nil, {on_list=on_list}) end, bufopts) ``` If you prefer loclist do something like this: ```lua local function on_list(options) vim.fn.setloclist(0, {}, ' ', options) vim.api.nvim_command('lopen') end ``` close #19182 Co-authored-by: Mathias Fußenegger <mfussenegger@users.noreply.github.com>
* feat(lua): allow vim.cmd to be indexed (#19238)Lewis Russell2022-07-20
|
* docs: fix vim.filetype.add by avoiding quotes (#19433)Javier Lopez2022-07-19
| | | | | | | | | | * Problem Quotes are special in doxygen, and should be escaped. *Sometimes* they cause doc generation issues. Like in #17785 * Solution Replace double quotes with single quotes
* 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.
* fix(lua): double entries in :lua completion #19410ii142022-07-17
| | | `:lua vim.ls<tab>` would list `lsp` twice.
* refactor(lsp): use autocmd api (#19407)ii142022-07-17
| | | | | | | * refactor(lsp): use autocmd api * refactor(lsp): inline BufWritePost and VimLeavePre callbacks
* fix(lsp): move augroup define to if statement (#19406)Raphael2022-07-17
|
* vim-patch:9.0.0055 (#19392)Gregory Anders2022-07-17
| | | | | | | | vim-patch:9.0.0055: bitbake files are not detected Problem: Bitbake files are not detected. Solution: Add bitbake filetype detection by file name and contents. (Gregory Anders, closes vim/vim#10697) https://github.com/vim/vim/commit/fa49eb482729a5fe7da9c9a5ed8d14f68afa55c7
* feat(defaults): mouse=nvi #19290matveyt2022-07-17
| | | | | | | | | | Problem: Since right-click can now show a popup menu, we can provide messaging to guide users who expect 'mouse' to be disabled by default. So 'mouse' can now be enabled by default. Solution: Do it. Closes #15521
* refactor: use `local api = vim.api`ii142022-07-15
|
* refactor: use npcall from vim.Fii142022-07-15
|
* refactor(lsp): make the use of local aliases more consistentii142022-07-15
|
* fix(treesitter): don't error when node argument of predicate is nil (#19355)Stephan Seitz2022-07-14
| | | | | | When the node mentioned in a predicate is not required for the query then predicates putting restrictions on that node shouldn't run. Fixes https://github.com/nvim-treesitter/nvim-treesitter/issues/2600
* fix(lsp): account for initializing servers in vim.lsp.start (#19329)Nicolas Hillegeer2022-07-12
| | | Fixes #19326
* fix(lsp): don't attach a client in lsp.start() if there is none (#19328)Nicolas Hillegeer2022-07-11
| | | | | | | vim.lsp.start_client() may fail (for example if the `cmd` is not executable). It produces a nice error notification in this case. Passing the `nil` value returned from an erroneous `vim.lsp.start_client()` call into `vim.lsp.buf_attach_client()` causes a meaty param validate exception message. Avoid this.
* fix(lsp): abort pending changes after flush when debouncing (#19314)Rishikesh Vaishnav2022-07-11
| | | | | | | | | | | Issuing a server request triggers `changetracking.flush` so as to make sure we're not operating on a stale state. This immediately triggers notification of any pending changes (as a result of debouncing) to the server. However, this happens in addition to the notification that is waiting on the debounce delay. Because we `nil` `buf_state.pending_change` when it is called, the fix is to also check that this is non-`nil` when it is called and exit if it is, as this being `nil` would mean that it originates from a pending change that has already been flushed out.
* feat(lsp): defaults: tagfunc, omnifunc (#19003)Mathias Fußenegger2022-07-10
| | | set `tagfunc` to `vim.lsp.tagfunc` and `omnifunc` to `vim.lsp.omnifunc` if empty when attaching a server
* fix(lsp): pcall nvim_del_augroup_by_name (#19302)Christian Clason2022-07-10
| | | fixup for #19283
* vim-patch:9.0.0049: csv and tsv files are not recognized (#19300)Christian Clason2022-07-10
| | | | | | Problem: Csv and tsv files are not recognized. Solution: Add patterns fo csv and tsv files. (Leandro Lourenci, closes vim/vim#10680) https://github.com/vim/vim/commit/99af91e5820c78a196c9272cd8ce5aa5be7bf374
* 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>
* feat(runtime)!: enable filetype.lua by default (#19216)Christian Clason2022-07-07
| | | | | | * revert to filetype.vim by setting `g:do_legacy_filetype` * skip either filetype.lua or filetype.vim via `g:did_load_filetypes` (Running both is no longer required and therefore no longer supported.)
* 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(filetype): remove call to vim.fn.resolve and pass filename to match functionsmjonas2022-07-06
| | | | | For example on MacOS, /etc/hostname.file is symlinked to /private/etc/hostname.file. We only care about the original file path though.