aboutsummaryrefslogtreecommitdiff
path: root/test/functional/lua
Commit message (Collapse)AuthorAge
...
* fix(vim.deprecate): show deprecation warning in devel versions as wellJongwook Choi2024-01-19
| | | | | | | | | | | | | | | | | | Problem: On devel(nightly) versions, deprecation warnings for hard-deprecated features are not being displayed. E.g., - to be removed in: 0.11 - hard-deprecation since 0.10 - soft-deprecation since 0.9 then 0.10-nightly (0.10.0-dev) versions as well as 0.10.0 (stable) should display the deprecation warning message. Solution: Improve the code and logic on `vim.deprecate()`, and improve test cases with mocked `vim.version()`.
* refactor(lua): refactored globaltermo2024-01-19
|
* docs: various #25289Justin M. Keyes2024-01-18
| | | | | | Co-authored-by: Jongwook Choi <wookayin@gmail.com> Co-authored-by: Oliver Marriott <hello@omarriott.com> Co-authored-by: Benoit de Chezelles <bew@users.noreply.github.com> Co-authored-by: Jongwook Choi <wookayin@gmail.com>
* test: refactor PathsLewis Russell2024-01-17
|
* test: big cleanup followupLewis Russell2024-01-17
| | | | Followup to 07a7c0ec
* test: use integers for API Buffer/Window/Tabpage EXT typesLewis Russell2024-01-16
|
* Merge pull request #26734 from bfredl/splitaroobfredl2024-01-13
|\ | | | | fix(buffer_updates): correct buffer updates when splitting empty line
| * fix(buffer_updates): correct buffer updates when splitting empty linebfredl2024-01-13
| | | | | | | | fixes #11591
* | test: rename (meths, funcs) -> (api, fn)Lewis Russell2024-01-12
| |
* | test: normalise nvim bridge functionsLewis Russell2024-01-12
| | | | | | | | | | - remove helpers.cur*meths - remove helpers.nvim
* | test: typing for helpers.methsLewis Russell2024-01-12
| |
* | test: use vim.mpack and vim.uv directlyLewis Russell2024-01-12
| |
* | test: use vim.inspect directlyLewis Russell2024-01-12
| |
* | test: remove helpers.sleep()Lewis Russell2024-01-12
| |
* | test: do not inject vim module into global helpersLewis Russell2024-01-12
|/
* feat(vim.iter): add Iter:flatten (#26786)JD2024-01-10
| | | | | Co-authored-by: Gregory Anders <greg@gpanders.com> Co-authored-by: Jongwook Choi <wookayin@gmail.com>
* refactor: format test/*Justin M. Keyes2024-01-03
|
* feature(diagnostic): add `vim.diagnostic.count()` (#26807)Evgeni Chasnovski2024-01-01
| | | | | | | | | | | | | feat(diagnostic): add `vim.diagnostic.count()` Problem: Getting diagnostic count based on the output of `vim.diagnostic.get()` might become costly as number of diagnostic entries grows. This is because it returns a copy of diagnostic cache entries (so as to not allow users to change them in place). Getting information about diagnostic count is frequently used in statusline, so it is important to be as fast as reasonbly possible. Solution: Add `vim.diagnostic.count()` which computes severity counts without making copies.
* test: simplify vim.fs testsdundargoc2023-12-26
| | | | The exec_lua wrapper is no longer necessary.
* feat(vim.deprecate): only issue warning if neovim version is high enoughdundargoc2023-12-25
| | | | | | | | | | | | As specified by MAINTAIN.md, features should be soft deprecated at first (meaning no warnings) to give people a chance to adjust. The problem with this approach is that deprecating a feature becomes harder than usual as during the soft deprecation period you need to remember not to issue a warning, and during the hard deprecation period you need to remember to start issuing a warning. This behavior is only enforced if the `plugin` parameter is `nil` as plugins may not want this specific behavior.
* refactor(lsp): move glob parsing to util (#26519)Steven Arcangeli2023-12-22
| | | | | | | | refactor(lsp): move glob parsing to vim.glob Moving the logic for using vim.lpeg to create a match pattern from a glob into `vim.glob`. There are several places in the LSP spec that use globs, and it's very useful to have glob matching as a generally-available utility.
* refactor: soft-deprecate diagnostic signs configured with :sign-define (#26618)Gregory Anders2023-12-18
| | | | | Diagnostic signs should now be configured with vim.diagnostic.config(), but "legacy" sign definitions should go through the standard deprecation process to minimize the impact from breaking changes.
* fix(lua): handle array with holes in luaeval() (#26630)zeertzjq2023-12-18
|
* fix(diagnostic): check for sign namespace instead of sign groupGregory Anders2023-12-13
|
* refactor(diagnostic): set sign by using extmark (#26193)Raphael2023-12-13
| | | | after sign implementation refactor by using extmark, we can use `nvim_buf_set_extmark` to set diagnostic sign instead use `sign_define`
* feat(iter): add `Iter.take` (#26525)Will Hopkins2023-12-12
|
* fix(lua): memory leak when using invalid syntax with exists() (#26530)zeertzjq2023-12-12
|
* feat(eval): exists() function supports checking v:lua functions (#26485)Raphael2023-12-12
| | | | Problem: Vimscript function exists() can't check v:lua functions. Solution: Add support for v:lua functions to exists().
* Merge pull request #26458 from famiu/refactor/options/optionindexdundargoc2023-12-10
|\
| * refactor(options): reduce `findoption()` usageFamiu Haque2023-12-09
| | | | | | | | | | | | Problem: Many places in the code use `findoption()` to access an option using its name, even if the option index is available. This is very slow because it requires looping through the options array over and over. Solution: Use option index instead of name wherever possible. Also introduce an `OptIndex` enum which contains the index for every option as enum constants, this eliminates the need to pass static option names as strings.
* | test: avoid repeated screen lines in expected stateszeertzjq2023-12-09
|/ | | | | | This is the command invoked repeatedly to make the changes: :%s/^\(.*\)|\%(\*\(\d\+\)\)\?$\n\1|\%(\*\(\d\+\)\)\?$/\=submatch(1)..'|*'..(max([str2nr(submatch(2)),1])+max([str2nr(submatch(3)),1]))/g
* test: use termopen() instead of :terminal more (#26462)zeertzjq2023-12-08
|
* fix(lua): allow nil values in serialized Lua arrays (#26329)Gregory Anders2023-12-07
| | | | | | | | | | | When we convert a Lua table to an Object, we consider the table a "dictionary" if it contains only string keys, and an array if it contains all numeric indices with no gaps. While rare, Lua tables can have both strictly numeric indices and gaps (e.g. { [2] = 2 }). These currently cannot be serialized because it is not considered an array. However, we know the maximum index of the table and as long as all of the keys in the table are numeric, it is still possible to serialize this table as an array. The missing indices will have nil values.
* fix(json): allow objects with empty keys #25564Emanuel2023-12-06
| | | | | | | | | | | | | | | | | | | | Problem: Empty string is a valid JSON key, but json_decode() treats an object with empty key as ":help msgpack-special-dict". #20757 :echo json_decode('{"": "1"}') {'_TYPE': [], '_VAL': [['', '1']]} Note: vim returns `{'': '1'}`. Solution: Allow empty string as an object key. Note that we still (currently) disallow empty keys in object_to_vim() (since 7c01d5ff9286d262097484c680e3a4eab49e2911): https://github.com/neovim/neovim/blob/f64e4b43e1191ff30d902730f752875aa55682ce/src/nvim/api/private/converter.c#L333-L334 Fix #20757 Co-authored-by: Justin M. Keyes <justinkz@gmail.com>
* feat(lua): implement Iter:join() (#26416)Gregory Anders2023-12-05
|
* fix(change): update fold after on_bytes (#26364)Jaehwang Jung2023-12-05
| | | | | | | | | | | | | | | | | | | | | | | | Problem: With vim.treesitter.foldexpr, `o`-ing two lines above a folded region opens the fold. This does not happen with legacy foldexprs. For example, make a markdown file with the following text (without indentation), enable treesitter fold, and follow the instruction in the text. put cursor on this line and type zoo<Esc> initially folded, revealed by zo # then this fold will be opened initially folded, revealed by o<Esc> Analysis: * `o` updates folds first (done in `changed_lines`), evaluating foldexpr, and then invokes `on_bytes` (done in `extmark_splice`). * Treesitter fold allocates the foldinfo for added lines (`add_range`) on `on_bytes`. * Therefore, when treesitter foldexpr is invoked while running `o`, it sees outdated foldinfo. Solution: `extmark_splice`, and then `changed_lines`. This seems to be the standard order in other places, e.g., `nvim_buf_set_lines`.
* test: check vim.wait() error message in fast context (#26242)zeertzjq2023-11-27
|
* fix(lua): disallow vim.wait() in fast contextsLewis Russell2023-11-27
| | | | | | | `vim.wait()` cannot be called in a fast callback since the main loop cannot be run in that context as it is not reentrant Fixes #26122
* fix(vim.region): handle multibyte inclusive selection properly (#26129)zeertzjq2023-11-21
|
* test: skip failing watch file tests on freebsd (#26110)Mathias Fußenegger2023-11-19
| | | | | | | | | Quick fix as follow up to https://github.com/neovim/neovim/pull/26108 kqueue only reports events on a watched folder itself, not for files created or deleted within. So the approach the PR took doesn't work on FreeBSD. We'll either need to bring back polling for it, combine watching with manual file tracking, or disable LSP file watching on FreeBSD
* perf(lsp): replace file polling on linux with per dir watcher (#26108)Mathias Fußenegger2023-11-19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Should help with https://github.com/neovim/neovim/issues/23291 On linux `new_fs_event` doesn't support recursive watching, but we can still use it to watch folders. The downside of this approach is that we may end up sending some false `Deleted` events. For example, if you save a file named `foo` there will be a intermediate `foo~` due to the save mechanism of neovim. The events we get from vim.uv in that case are: - rename: foo~ - rename: foo~ - rename: foo - rename: foo - change: foo - change: foo The mechanism in this PR uses a debounce to reduce this to: - deleted: foo~ - changed: foo `foo~` will be the false positive. I suspect that for the LSP case this is good enough. If not, we may need to follow up on this and keep a table in memory that tracks available files.
* refactor(snippet): rename test utilitiesMaria José Solano2023-11-17
|
* feat(lsp): support for choice snippet nodesMaria José Solano2023-11-17
|
* feat: add vim.text module (#26069)Gregory Anders2023-11-16
|
* test: skip failing test on freebsddundargoc2023-11-10
| | | | | The watch_file test started failing on bsd after 3ca967387c49c754561c3b11a574797504d40f38.
* fix(f_wait): flush UI before blocking (#25962)zeertzjq2023-11-10
|
* fix(lua): correct return value for on_key with no arguments (#25911)altermo2023-11-07
|
* feat(stdlib): add vim.base64 module (#25843)Gregory Anders2023-10-31
| | | Add base64 encode() and decode() functions to a vim.base64 module.
* fix(lsp): do not cancel snippet when selecting placeholder (#25835)Maria José Solano2023-10-30
|
* fix(diagnostic): virtual_text prefix function should have index and total ↵Jongwook Choi2023-10-27
| | | | | | | | | | | | | (#25801) The prefix option of the diagnostic virtual text can be a function, but previously it was only a function of diagnostic. This function should also have additional parameters index and total, more consistently and similarily as in the prefix function for `vim.diagnostic.open_float()`. These additional parameters will be useful when there are too many number of diagnostics in a single line.