Commit Graph

19886 Commits

Author SHA1 Message Date
Gregory Anders
60d3bb745d
fix(filetype): set default ft_ignore_pat in filetype.lua (#16917)
This default value is also set in filetype.vim, but if filetype.vim is
disabled the variable is never defined, which causes errors in some of
the dist#ft detection functions.
2022-01-04 15:02:01 -07:00
Robin Gagnon
8ade8009ee
feat(filetype.lua): Add typescript extension to filetype detection (#16923)
port from `filetype.vim`; also add `getline` convenience function
2022-01-04 22:34:55 +01:00
Gregory Anders
39238435db
fix(api): force redefinition of user commands by default (#16918) 2022-01-04 11:51:45 -07:00
dundargoc
0b0c4f7dfa
chore: fix typos (#16816)
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>
2022-01-04 11:07:40 -07:00
Sam McCall
d6f0c9539c
fix(lsp): suppress ContentModified errors from UI (#16904)
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
2022-01-04 09:28:13 -08:00
Gregory Anders
3fd454bd4a
feat: filetype.lua (#16600)
Adds a new vim.filetype module that provides support for filetype detection in
Lua.
2022-01-04 07:28:29 -07:00
Daniel Steinberg
cc62f3d6cb
test: make test for #14040 more stable (#16911) 2022-01-04 07:25:28 -07:00
Björn Linse
e79a588937
Merge pull request #16912 from shadmansaleh/enhance/lua_cmd_inspect
feat(lua): make :lua =expr print result of expr
2022-01-04 14:34:42 +01:00
shadmansaleh
d44254641f feat(lua): make =expr print result of expr 2022-01-04 16:08:07 +06:00
Michael Lingelbach
207307d0fa
fix(lsp): explicitly pass bufnr in didSave handler (#16906)
Addresses a regression introduced by the stricter type checking
in lua api functions from https://github.com/neovim/neovim/pull/16745
2022-01-03 21:03:16 -05:00
James McCoy
efe6485aca
Merge pull request #16903 from dundargoc/ci/install-flake-with-apt
ci: install flake8 with apt instead of pip
2022-01-03 16:23:20 -05:00
Dundar Göc
ec615abd1f ci: install flake8 with apt instead of pip 2022-01-03 21:54:23 +01:00
James McCoy
1036ca846e
Merge pull request #16901 from dundargoc/ci/add-codeowners
ci: add jamessan as codeowner for ci related files
2022-01-03 14:50:40 -05:00
Shadman
e402103911
chore(build): compile lua only on release builds (#16859) 2022-01-03 12:44:30 -07:00
Gregory Anders
e6c1545b19
fix(lsp): resolve nil bufnr (#16902)
Related: #16889, #16745
2022-01-03 12:40:09 -07:00
Dundar Göc
b402cd3315 ci: add jamessan as codeowner for ci related files
[skip ci]
2022-01-03 20:27:31 +01:00
Christian Clason
6aeaff1220
vim-patch:8.2.3995: not all sshconfig files are detected as such (#16899)
Problem:    Not all sshconfig files are detected as such.
Solution:   Adjust the patterns used for sshconfig detection. (David Auer,
            closes vim/vim#9322)
9acf2d8be9
2022-01-03 19:29:46 +01:00
dundargoc
be255557ce
ci: simplify ci_fold function (#16874) 2022-01-03 11:47:11 -05:00
James McCoy
6ed9ddec29
Merge pull request #16895 from dundargoc/ci/fix-shellcheck-warnings
ci: fix shellcheck errors introduced in version 0.8.0
2022-01-03 11:40:20 -05:00
dundargoc
297ff97647
fix(lua): stricter type check when calling API function (#16745)
Solves #13651

Co-authored-by: Gregory Anders <greg@gpanders.com>
2022-01-03 08:00:50 -07:00
Sean Dewar
76435c0cfa
docs(usr_05): fix section numbers (#16886)
Other refs to 05.3 don't need to be updated as they refer to the simple mappings
section anyway. Seems they weren't updated when the defaults.vim section was
added as 05.3 instead.
2022-01-03 14:52:01 +01:00
Gregory Anders
36662c9612
fix: resolve nil arguments to API functions (#16889)
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.
2022-01-03 06:48:01 -07:00
Dundar Göc
167c10130c ci: fix shellcheck errors introduced in version 0.8.0
Solved following shellcheck warnings:
SC2030
SC2295
SC2015
2022-01-03 12:47:06 +01:00
James McCoy
2f31e7b88b
Merge pull request #16890 from dundargoc/ci/nuke-before-install
ci: remove unnecessary before_install script
2022-01-02 20:13:07 -05:00
Dundar Göc
e71fbf2eb0 ci: remove unnecessary before_install script 2022-01-02 23:46:46 +01:00
James McCoy
b0993bdc45
Merge pull request #16853 from jamessan/clint-master-only
ci: run lint only on master branch
2022-01-02 14:07:01 -05:00
James McCoy
b823ff9a60
Merge pull request #16883 from dundargoc/ci/remove-watchdog
ci: remove watchdog function run_tests_wd
2022-01-02 12:54:42 -05:00
Dundar Göc
64f23c27e2 ci: remove watchdog function run_tests_wd
It's only used once for running check-single-includes (which I strongly
suspect it doesn't need anyway), its core logic is incorrect since both the
variables "tempsize" and "prev_temsize" are never defined and parsing ps
is incredibly fragile.
2022-01-02 18:23:28 +01:00
Michael Lingelbach
e42c906597
fix(lsp): always use target bufnr in location handler (#16876) 2022-01-02 07:55:16 +01:00
Gregory Anders
838631e29e
fix(diagnostic): improve validation for list arguments (#16855)
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.
2022-01-01 12:58:34 -07:00
Shadman
55c4393e9f
feat(lua): add support for multiple optional types in vim.validate (#16864) 2022-01-01 12:35:15 -07:00
dundargoc
f86039de1e
ci: remove outdated travis-specific code (#16869) 2022-01-01 12:42:26 -05:00
Christian Clason
302beaa36b
build(deps): bump tree-sitter to v0.20.2 (#16863) 2022-01-01 17:59:00 +01:00
James McCoy
603db555a4
Merge pull request #16870 from dundargoc/refactor/pvs/V009
refactor(PVS/V009): add special comment at top of file required by PVS
2022-01-01 11:55:27 -05:00
James McCoy
e5f7b61136
Merge pull request #16840 from zeertzjq/ci-clang-13
ci: bump clang version to 13 in asan and tsan
2022-01-01 11:43:38 -05:00
Björn Linse
273b5c9282
Merge pull request #16871 from bfredl/luaperf
perf(api): elide luaref copy when setting 'callback' in nvim_set_keymap
2022-01-01 17:21:26 +01:00
Björn Linse
9f489f591d perf(api): elide luaref copy when setting 'callback' in nvim_set_keymap 2022-01-01 16:41:16 +01:00
Dundar Göc
68b23b08a0 refactor(PVS/V009): add special comment at top of file required by PVS
More info: https://pvs-studio.com/en/docs/warnings/v009/
2022-01-01 16:23:22 +01:00
zeertzjq
a5eadbaf3c
test: make some tests more stable (#16860) 2022-01-01 07:28:52 -07:00
Björn Linse
5dbc64dced
Merge pull request #16857 from dundargoc/vim-8.2.3956
vim-patch:8.2.3956
2022-01-01 14:15:54 +01:00
Christian Clason
b0f21adef0
vim-patch:8.2.3964: some common lisp and scheme files not recognized (#16866)
Problem:    Some common lisp and scheme files not recognized.
Solution:   Recognize *.asd as lisp and *.sld as scheme. (Alex Vear,
            closes vim/vim#9447)
654b729c4c
2022-01-01 14:00:33 +01:00
Dundar Göc
f6c89e03d7 vim-patch:8.2.3956: duplicate assignment
Problem:    Duplicate assignment.
Solution:   Remove the second assignment. (closes vim/vim#9442)
4b1478093e
2022-01-01 12:44:26 +01:00
Christian Clason
36a8f31a37
vim-patch:partial 04fb91668482 (#16852)
Update runtime files
04fb916684

omits doc/usr_41.txt (rewritten to focus on vim9script)
2022-01-01 10:56:55 +01:00
zeertzjq
6a932f68e6 ci: bump clang version to 13 in asan and tsan 2022-01-01 06:24:48 +08:00
Björn Linse
b218d02c44
Merge pull request #16594 from shadmansaleh/feat/api/lua_keymaps
feat(api): add support for lua function & description in keymap
2021-12-31 20:10:35 +01:00
shadmansaleh
b411f436d3 feat(api): add support for lua function & description in keymap
Behavioral changes:

1. Added support for lua function in keymaps in
--------------------------------------------
- nvim_set_keymap
  Can set lua function as keymap rhs like following:
```lua
vim.api.nvim_{buf_}set_keymap('n', '<leader>lr', '', {callback = vim.lsp.buf.references})
```
  Note: lua function can only be set from lua . If api function being
  called from viml or over rpc this option isn't available.
- nvim_{buf_}get_keymap
  When called from lua, lua function is returned is `callback` key .
  But in other cases callback contains number of the function ref.
- :umap, nvim_del_keymap & nvim_buf_del_keymap clears lua keymaps correctly.
- :map commands for displaing rhs .
   For lua keymaps rhs is displayed as <Lua function ref_no>
   Note: lua keymap cannot be set through viml command / functions.
- mapargs()
  When dict is false it returns string in `<Lua function ref_no>`
  format (same format as :map commands).
  When dict is true it returns ref_no number in `callback` key.
- mapcheck()
  returns string in `<Lua function ref_no>` format (same format as :map commands).

2. Added support for keymap description
---------------------------------------
- nvim_{buf_}set_keymap: added `desc` option in opts table .
 ```lua
vim.api.nvim_set_keymap('n', '<leader>w', '<cmd>w<cr>', {desc='Save current file'})
```
- nvim_{buf_}get_keymap: contains `desc` in returned list.
- commands like `:nmap <leader>w` will show description in a new line below rhs.
- `maparg()` return dict contains `desc`.
2022-01-01 00:26:58 +06:00
Björn Linse
5c1b8b77c5 fix(runtime): add missing release metadata 2021-12-31 19:04:37 +01:00
James McCoy
35034da779
ci: run lint only on master branch
The list of known lint issues is only updated for the master branch, so
other branches report lots of false positive issues.
2021-12-31 12:09:23 -05:00
James McCoy
fc62fdd42f
Merge pull request #16846 from dundargoc/ci/remove-brew-workaround
ci: remove outdated brew workaround that isn't needed anymore
2021-12-31 11:24:48 -05:00
Björn Linse
dc3a16abfc
Merge pull request #16851 from zeertzjq/vim-8.2.3952
vim-patch:8.2.3952: first line not redrawn when adding lines to an empty buffer
2021-12-31 15:48:02 +01:00