Commit Graph

25285 Commits

Author SHA1 Message Date
Christian Clason
2a298f2e48 fix(treesitter): update queries from nvim-treesitter
remove self-injection for C preprocessor macros (can be very slow)
2023-04-01 12:19:15 +02:00
Christian Clason
90fdaf55c9 fix(tests): adapt treesitter/highlight_spec priority test
Still relied on the old `@Foo`->`Foo` capture to highlight mechanism;
use capture with default highlight instead.
2023-04-01 12:19:15 +02:00
Christian Clason
dee559d744 build(deps): bump tree-sitter-viml to HEAD 2023-03-31 15:58:19 +02:00
Lewis Russell
83bfd94d1d
refactor(loader): cache hash information
Whenever we run fs_stat() on a path, save this information in the loader
so it can be re-used.

- Loader.loadfile: Remove arguments `hash` as it is no longer needed.

- Loader.loader: Use _G.loadstring instead of Loader.load
  This allows plugins to wrap loadstring to inspection and profiling

- factor out read file logic
2023-03-31 13:05:22 +01:00
Sindre T. Strøm
b34097fe6d
fix(api): return both link and attributes with nvim_get_hl (#22824)
Problem: No way to get the actual highlight attributes for a linked
group through |nvim_get_hl()| (not the attributes from the link target).
Solution: Return the actual attributes as well as the link target name.
2023-03-31 12:52:53 +02:00
Akin
ed10e4ef60
fix(diagnostic): use correct field name for tags (#22835)
LSP tags are added to the diagnostic as "tags" but referred to as "_tags"
in the diagnostic underline handler
2023-03-31 11:23:19 +01:00
Lewis Russell
4cff3aceea
fix(loader): disable profiling by default 2023-03-31 09:43:13 +01:00
Lewis Russell
5bf2f4b3c2
fix(filetype): make recursive work...again (#22826) 2023-03-30 17:24:50 +01:00
Lewis Russell
226a6c3eae
feat(diagnostic): add support for tags
The LSP spec supports two tags that can be added to diagnostics:
unnecessary and deprecated. Extend vim.diagnostic to be able to handle
these.
2023-03-30 14:49:58 +01:00
Lewis Russell
8fa7d833cf
Merge pull request #22791 from lewis6991/refactor/loadermisc
refactor(loader): changes
2023-03-30 13:57:59 +01:00
Lewis Russell
e5fa2e3a5d
fix(autocmd): handle recursion for force set (#22820) 2023-03-30 11:35:13 +01:00
Lewis Russell
61e54f2636
feat: add vim.treesitter.language.get_filetypes() (#22643) 2023-03-30 10:26:28 +01:00
Lewis Russell
8b7fb668e4
fix(filetype): avoid recursive FileType autocmds (#22813) 2023-03-29 19:54:12 +01:00
Christian Clason
92005db760
build(deps): switch to Launchpad for libvterm and libtermkey (#22811)
Problem: www.leonerd.org.uk is sometimes unreachable

Solution: switch to Launchpad URLs for libvterm (official page) and
libtermkey (source mirror for Ubuntu package)
2023-03-29 14:39:11 +02:00
Christian Clason
196f69909d
vim-patch:9.0.1430: Livebook files are not recognized (#22808)
Problem:    Livebook files are not recognized.
Solution:   Add a pattern for Livebook files. (Mathias Jean Johansen,
            closes vim/vim#12203)

6400203517

Co-authored-by: Mathias Jean Johansen <mathias@mjj.io>
2023-03-29 10:23:52 +02:00
Michal Liszcz
b7748662ed
fix(api): Use local LastSet structure in nvim_get_option_info (#22741)
fix(api): use local LastSet structure in nvim_get_option_info

* nvim_get_option_info is deprecated.
  It is always using the global LastSet information as reported in #15232.
* nvim_get_option_info2 is added.
  The new function additionally accepts an 'opts' table {scope, buf, win}
  allowing to specify the option scope and query local options from another
  buffer or window.
2023-03-29 09:59:01 +02:00
dundargoc
eac75a971d
Merge pull request #22759 from dundargoc/build/wintools 2023-03-28 18:46:58 +02:00
dundargoc
81abd5c5c7 build: download wintools executables separately
The wintools executables are stored in a zip file, making it
inconvenient to bump these during releases. Instead, unpack the
executables in the deps repository and download each executable
separately.
2023-03-28 16:18:13 +02:00
dundargoc
b02ee27e51 build: drop curl.exe on Windows
Curl is already shipped by default on Windows 10 starting from versions
1803. As we already require version 1809 we can safely remove it.
2023-03-28 16:18:13 +02:00
zeertzjq
bad218cd64
vim-patch:9.0.1429: invalid memory access when ending insert mode (#22792)
Problem:    Invalid memory access when ending insert mode.
Solution:   Check if the insert_skip value is valid.

1a08a3e2a5

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-27 09:37:04 +08:00
Lewis Russell
fd70a9dca1 refactor(loader): simplify tracking logic 2023-03-26 14:11:43 +01:00
Lewis Russell
25fa051fa1 feat(vim.fs): improve normalize
- Add options argument with an option to expand env vars
- Resolve '//' -> '/'
- Use in vim.loader
2023-03-26 13:30:11 +01:00
Lewis Russell
ffd8cd1a96 refactor(loader): add typing for package.loaders 2023-03-26 12:51:56 +01:00
Lewis Russell
fab8dab6b6 refactor(loader): remove BufWritePost autocmd 2023-03-26 12:47:06 +01:00
Lewis Russell
3c82ce0d62 refactor(loader): use vim.fs 2023-03-26 12:46:24 +01:00
Folke Lemaitre
2257ade3dc
feat(lua): add vim.loader
feat: new faster lua loader using byte-compilation
2023-03-26 11:42:15 +01:00
Jon Huhn
6a6191174a
test: fix flaky watchfiles tests (#22637) 2023-03-26 10:41:27 +01:00
zeertzjq
4863ca6b89
test: use exec_capture() in more places (#22787)
Problem:
Using `meths.exec2("code", { output = true })` is too verbose.

Solution:
Use exec_capture() in more places.
2023-03-26 10:49:32 +08:00
zeertzjq
4eef5ac453
vim-patch:9.0.1428: cursor in wrong position when leaving insert mode (#22786)
Problem:    Cursor in wrong position when leaving insert mode.
Solution:   Update the w_valid flags.  Position the cursor also when not
            redrawing. (closes vim/vim#12137)

c174c2e58c

Co-authored-by: Bram Moolenaar <Bram@vim.org>
2023-03-26 09:24:04 +08:00
Andreas Schneider
e3dab4b326
fix: snprintf buffer overflow detected by -D_FORTIFY_SOURCE=3 (#22780)
Problem:
Wrong buffer size argument passed to snprintf() in set_cmdarg():
	Thread no. 1 (24 frames)
	 #8 snprintf at /usr/include/bits/stdio2.h:54
	 #9 set_cmdarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7044
	 #10 apply_autocmds_group at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1843
	 #11 apply_autocmds_exarg at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/autocmd.c:1549
	 #12 readfile at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:617
	 #13 buf_reload at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:5038
	 #14 buf_check_timestamp at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4952
	 #15 check_timestamps at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/fileio.c:4678
	 #16 ex_checktime at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_cmds2.c:765
	 #17 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620
	 #18 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275
	 #19 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584
	 #20 ex_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/eval.c:7727
	 #21 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1620
	 #22 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275
	 #23 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584
	 #24 do_ucmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/usercmd.c:1661
	 #25 execute_cmd0 at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:1612
	 #26 do_one_cmd at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:2275
	 #27 do_cmdline at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/ex_docmd.c:584
	 #28 nv_colon at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:4058
	 #29 normal_execute at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:1172
	 #30 state_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/state.c:88
	 #31 normal_enter at /usr/src/debug/neovim-0.8.2-2.fc38.x86_64/src/nvim/normal.c:471

Solution:
Subtract the offset from the buffer size.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
2023-03-26 08:22:14 +08:00
bfredl
13eb6c2554
Merge pull request #22762 from bfredl/hl2cterm
fix(api): make nvim_get_hl return 'cterm' attrs properly
2023-03-25 19:26:45 +01:00
Evgeni Chasnovski
fe9cbcb3a5
feat(api): nvim_exec2(), deprecate nvim_exec() #19032
Problem:
The signature of nvim_exec() is not extensible per ":help api-contract".

Solution:
Introduce nvim_exec2() and deprecate nvim_exec().
2023-03-25 09:58:48 -07:00
Roberto Pommella Alegro
257d894d75
feat(lsp): render markdown in docs hover #22766
Problem:
LSP docs hover (textDocument/hover) doesn't handle HTML escape seqs in markdown.

Solution:
Convert common HTML escape seqs to a nicer form, to display in the float.
closees #22757

Signed-off-by: Kasama <robertoaall@gmail.com>
2023-03-25 12:46:07 -04:00
dundargoc
74f05a152d
docs(test): using cmake directly (without make) #22781 2023-03-25 09:33:42 -07:00
Ryan Jenkins
dc5a433025
docs: how to debug TUI using gdb/lldb #22771
docs: Add info to the `Debug: TUI` docs about gdb/lldb usage
2023-03-25 12:25:28 -04:00
Micah Halter
36ee10057a
fix(lsp): add missing silent check in lsp hover handler (#22763)
Fixup to #21531.
2023-03-25 21:01:39 +08:00
Jakub Łuczyński
42876ddc7a
docs: more details about vim.region (#21116) 2023-03-25 16:28:59 +08:00
Lucas Merritt
063e93864a
refactor(PVS/V1048): remove duplicated assignments (#21873) 2023-03-25 12:11:14 +08:00
zeertzjq
aab4443bb9
vim-patch:9.0.1426: indent wrong after "export namespace" in C++ (#22777)
Problem:    Indent wrong after "export namespace" in C++.
Solution:   Skip over "inline" and "export" in any order. (Virginia Senioria,
            closes vim/vim#12134, closes vim/vim#12133)

99e4ab2a1e

Co-authored-by: Virginia Senioria <91khr@users.noreply.github.com>
2023-03-25 09:27:42 +08:00
Lewis Russell
ac7397f4a0
fix(treesitter): add missing deprecate 2023-03-24 16:31:30 +00:00
Lewis Russell
cbbf8bd666
feat(treesitter)!: deprecate top level indexes to modules (#22761)
The following top level Treesitter functions have been moved:
  - vim.treesitter.inspect_language() -> vim.treesitter.language.inspect()
  - vim.treesitter.get_query_files() -> vim.treesitter.query.get_files()
  - vim.treesitter.set_query() -> vim.treesitter.query.set()
  - vim.treesitter.query.set_query() -> vim.treesitter.query.set()
  - vim.treesitter.get_query() -> vim.treesitter.query.get()
  - vim.treesitter.query.get_query() -> vim.treesitter.query.get()
  - vim.treesitter.parse_query() -> vim.treesitter.query.parse()
  - vim.treesitter.query.parse_query() -> vim.treesitter.query.parse()
  - vim.treesitter.add_predicate() -> vim.treesitter.query.add_predicate()
  - vim.treesitter.add_directive() -> vim.treesitter.query.add_directive()
  - vim.treesitter.list_predicates() -> vim.treesitter.query.list_predicates()
  - vim.treesitter.list_directives() -> vim.treesitter.query.list_directives()
  - vim.treesitter.query.get_range() -> vim.treesitter.get_range()
  - vim.treesitter.query.get_node_text() -> vim.treesitter.get_node_text()
2023-03-24 14:43:14 +00:00
Christian Clason
ee5008f878
vim-patch:9.0.1425: "wat" and "wast" files are one filetype (#22774)
Problem:    "wat" and "wast" files are one filetype.
Solution:   Add a separate filetype for "wat" files. (Amaan Qureshi,
            closes vim/vim#12165)

3ea62381c5

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-03-24 14:06:04 +01:00
dundargoc
b155608bff
build: set CMAKE_C_STANDARD to 99 for all dependencies
Older gcc versions (4.x) require passing --std=c99 compiler flag to
prevent warnings from being emitted. Instead of setting it for each
dependency, it's easier to just pass the CMAKE_C_STANDARD flag to all
dependencies. This also prevents the scenario of us forgetting to set it
if we add new dependencies.
2023-03-24 10:22:15 +01:00
dundargoc
a478fd4175
ci: use "ci" as the commit type for dependabot updates 2023-03-24 05:39:18 +01:00
dependabot[bot]
b2253cd000
build(deps): bump actions/stale from 7 to 8
Bumps [actions/stale](https://github.com/actions/stale) from 7 to 8.
- [Release notes](https://github.com/actions/stale/releases)
- [Changelog](https://github.com/actions/stale/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/stale/compare/v7...v8)
2023-03-23 23:32:45 +07:00
zeertzjq
3875b1fc8d
ci(labeler): don't automatically add "lua" label (#22765)
The labeler adds "lua" label to too many files. When there is already
a "treesitter" or "lsp" label, a "lua" label isn't useful. Instead it's
better to add the label manually to PRs for general Lua support.
2023-03-23 21:40:50 +08:00
bfredl
6d267ad30c fix(api): make nvim_get_hl return 'cterm' attrs properly 2023-03-23 13:42:00 +01:00
luukvbaal
b02880593e
build(win): export extern symbols for use in FFI #22756
Makes `extern` variables accessible through ffi on Windows.

Follow-up to https://github.com/neovim/neovim/pull/15999
2023-03-23 04:58:50 -07:00
Lewis Russell
4e4203f71b
fix(treesitter): annotations
- Begin using `@package` in place of `@private` for functions
that are accessed internally but outside their defined class.

- Rename Node -> TSP.Node
2023-03-23 11:23:51 +00:00
Null Chilly
c0fe6c040e
feat(api): add nvim_get_hl (#22693)
Problem: no way of getting all highlight group definitions in a namespace.

Solution: add `nvim_get_hl()`, deprecate `nvim_get_hl_by_name()` and `nvim_get_hl_by_id()`.
2023-03-23 10:31:39 +01:00