Lewis Russell
b75acd2f94
fix(treesitter): disable folding in inspect_tree() ( #22885 )
2023-04-04 14:07:27 +02:00
Lewis Russell
090ade4af6
refactor(treesitter): delegate region calculation to treesitter ( #22576 )
2023-04-04 13:58:16 +02:00
danilax999
469e6bfc56
fix(treesitter): use capture metadata range if exists
...
use `treesitter.get_range` instead of inline expression
2023-04-04 12:26:21 +01:00
Christian Clason and Johan Kotlinski
e30cc8be19
vim-patch:9.0.1438: .fs files are falsely recognized as forth files ( #22871 )
...
Problem: .fs files are falsely recognized as forth files.
Solution: Check 100 lines for something that looks like forth. (Johan
Kotlinski, closes vim/vim#12219 , closes vim/vim#11988 )
https://github.com/vim/vim/commit/065088d5549e7711668321cc5a77c9a9b684b142
Co-authored-by: Johan Kotlinski <kotlinski@gmail.com >
2023-04-03 16:27:49 +02:00
Luuk van Baal
a930245557
refactor(lua): get all marks instead of iterating over namespaces
...
Inspector now also includes highlights set in anonymous namespaces.
Close #22732
2023-04-02 19:14:23 +02:00
Gregory Anders
643c0ed571
feat: allow function passed to defaulttable to take an argument ( #22839 )
...
Pass the value of the key being accessed to the create function, to
allow users to dynamically generate default values.
2023-04-01 08:02:58 -06:00
Sizhe Zhao
6a4ebf894f
fix(health): stop using deprecated ts.language.inspect_language() ( #22850 )
2023-04-01 15:47:20 +02:00
Christian Clason
d7f7450017
refactor(treesitter)!: rename help parser to vimdoc
2023-04-01 15:07:16 +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
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
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
61e54f2636
feat: add vim.treesitter.language.get_filetypes() ( #22643 )
2023-03-30 10:26:28 +01:00
Christian Clason and Mathias Jean Johansen
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 )
https://github.com/vim/vim/commit/64002035178ac3e0d9ab7269d1bf06c6ede5a854
Co-authored-by: Mathias Jean Johansen <mathias@mjj.io >
2023-03-29 10:23:52 +02: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
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
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
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
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 and Amaan Qureshi
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 )
https://github.com/vim/vim/commit/3ea62381c527395ae701715335776f427d22eb7b
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com >
2023-03-24 14:06:04 +01: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
meredith
ea0b66d208
fix(lsp): Jump to tag locations reliably when :ltag is used ( #22750 )
2023-03-23 08:27:53 +01:00
Justin M. Keyes
410dc3349f
Merge #22736 from justinmk/gsplit
...
feat(vim.gsplit): gain features of vim.split
2023-03-22 20:12:40 -04:00
Lewis Russell
28cfcf5126
fix(api): vim.filetype.get_option() ( #22753 )
...
- Fix a bug in the cache
- Set some buffer options on the dummy buffer
2023-03-22 16:49:04 +00:00
Justin M. Keyes
e51139f5c1
refactor(vim.gsplit): remove "keepsep"
...
string.gmatch() is superior, use that instead.
2023-03-22 17:46:01 +01:00
Justin M. Keyes
8a70adbde0
fix(vim.version): prerelease compare
...
Problem:
semver specifies that digit sequences in a prerelease string should be
compared as numbers, not lexically: https://semver.org/#spec-item-11
> Precedence for two pre-release versions with the same major, minor,
> and patch version MUST be determined by comparing each dot separated
> identifier from left to right until a difference is found as follows:
> 1. Identifiers consisting of only digits are compared numerically.
> 2. Identifiers with letters or hyphens are compared lexically in ASCII sort order.
> 3. Numeric identifiers always have lower precedence than non-numeric identifiers.
> 4. A larger set of pre-release fields has a higher precedence than a smaller set, if all of the preceding identifiers are equal.
Example:
1.0.0-alpha < 1.0.0-alpha.1 < 1.0.0-alpha.beta < 1.0.0-beta < 1.0.0-beta.2 < 1.0.0-beta.11 < 1.0.0-rc.1 < 1.0.0.
Solution:
cmp_prerel() treats all digit sequences in a prerelease string as
numbers. This doesn't _exactly_ match the spec, which specifies that
only dot-delimited digit sequences should be treated as numbers...
2023-03-22 17:46:01 +01:00
Justin M. Keyes
9c49c10470
feat(vim.gsplit): gain features of vim.split
...
Problem:
- vim.split has more features than vim.gsplit.
- Cannot inspect the "separator" segments of vim.split or vim.gsplit.
Solution:
- Move common implementation from vim.split into vim.gsplit.
- TODO: deprecate vim.split in favor of vim.totable(vim.gsplit())?
- Introduce `keepsep` parameter.
Related: 84f66909e4
2023-03-22 17:46:01 +01:00
Amaan Qureshi
48ce2ef912
vim-patch:9.0.{1419,1421,1422,1423}: some files are not recognized ( #22749 )
...
vim-patch:9.0.1419: Lean files are not recognized
Problem: Lean files are not recognized.
Solution: Add a pattern for Lean files. (Amaan Qureshi, closes vim/vim#12177 )
https://github.com/vim/vim/commit/4a5c39fc52a73d46ac77cf574f765a465befc3c0
vim-patch:9.0.1421: Nu files are not recognized
Problem: Nu files are not recognized.
Solution: Add a pattern for Nu files. (Amaan Qureshi, closes vim/vim#12172 )
https://github.com/vim/vim/commit/8aa2a37f8983a7863afa32d9ffbe64b2f2bc70be
vim-patch:9.0.1422: Sage files are not recognized
Problem: Sage files are not recognized.
Solution: Add a pattern for Sage files. (Amaan Qureshi, closes vim/vim#12176 )
https://github.com/vim/vim/commit/d0639d717ba7cf8b04b588aadd0b379ed43a5f1f
vim-patch:9.0.1423: WebAssembly Interface Type files are not recognized
Problem: WebAssembly Interface Type files are not recognized.
Solution: Add a pattern for WIT files. (Amaan Qureshi, closes vim/vim#12173 )
https://github.com/vim/vim/commit/890c77203637626b1005db818667084d11e653e7
2023-03-22 16:19:56 +08:00
Christian Clason and Amaan Qureshi
0c9ed19af3
vim-patch:9.0.1417: ESDL files are not recognized
...
Problem: ESDL files are not recognized.
Solution: Add a pattern for ESDL files. (Amaan Qureshi, closes vim/vim#12174 )
https://github.com/vim/vim/commit/a1fa8b3ac2f7b54c7901ad3eb0ba8b8290912509
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com >
2023-03-20 21:08:31 +01:00
Christian Clason and Amaan Qureshi
d11986171b
vim-patch:9.0.1415: Crystal files are not recognized
...
Problem: Crystal files are not recognized.
Solution: Add a pattern for Crystal files. (Amaan Qureshi, closes vim/vim#12175 )
https://github.com/vim/vim/commit/7c4516fe93d865f4ef1877181f8156b8b9331856
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com >
2023-03-20 21:07:46 +01:00
Justin M. Keyes
a40eb7cc99
feat(vim.version): more coercion with strict=false
...
Problem:
"tmux 3.2a" (output from "tmux -V") is not parsed easily.
Solution:
With `strict=false`, discard everything before the first digit.
- rename Semver => Version
- rename vim.version.version() => vim.version._version()
- rename matches() => has()
- remove `opts` from cmp()
2023-03-20 13:40:38 +01:00
Justin M. Keyes
a715e6f87e
refactor(vim.version): use lazy.nvim semver module
...
Now the Nvim version string "v0.9.0-dev-1233+g210120dde81e" parses
correctly.
2023-03-20 13:40:38 +01:00
Justin M. Keyes and Folke Lemaitre
990c481551
refactor(vim.version): use lazy.nvim semver module
...
Use semver code from https://github.com/folke/lazy.nvim
License: Apache License 2.0
Co-authored-by: Folke Lemaitre <folke.lemaitre@gmail.com >
2023-03-20 13:36:55 +01:00
Lewis Russell
e5641df6d3
feat: add vim.filetype.get_option()
2023-03-20 10:06:32 +00:00
Amaan Qureshi
66ba81a6f7
vim-patch:9.0.1412: Pony files are not recognized ( #22721 )
...
Problem: Pony files are not recognized.
Solution: Add a pattern for Pony files. (Amaan Qureshi, closes vim/vim#12155 )
https://github.com/vim/vim/commit/6e377eca8de4c0c0d25808beb7de7676194ebf1d
2023-03-18 17:34:31 +08:00
Christian Clason
86c164d2a1
Merge pull request #22699 from clason/vim-9.0.1406
...
vim-patch:9.0.{1406,1407,1408,1409}: some files are not recognized
2023-03-17 13:40:15 +01:00
Yochem van Rosmalen
2720d2c793
fix(treesitter): InspectTree does not respect 'splitright' #22692
...
Problem:
vim.treesitter.inspect_tree() and :InspectTree does not respect 'splitright'.
Solution:
- Change the default `command` from `topleft 60vnew` to `60vnew`.
- Change :InspectTree to respect command mods (`:vertical`, count, etc.).
Closes #22656
2023-03-17 04:41:57 -07:00
August Masquelier
6162269fa3
fix(lsp): avoid switching buffers on lsp attach ( #22689 )
2023-03-17 12:26:13 +01:00
Christian Clason and Gabriel Kakizaki
571b50be16
vim-patch:9.0.1409: racket files are recognized as scheme
...
Problem: Racket files are recognized as scheme.
Solution: Recognize rackets files separately. (Gabriel Kakizaki,
closes vim/vim#12164 , closes vim/vim#12162 )
https://github.com/vim/vim/commit/d11ac403db07b6eac43882485e98caeb5e83e2e5
Co-authored-by: Gabriel Kakizaki <gkakizaki@gmail.com >
2023-03-17 10:06:56 +01:00
Christian Clason and Amaan Qureshi
f83d8ea279
vim-patch:9.0.1408: QMLdir files are not recognized
...
Problem: QMLdir files are not recognized.
Solution: Add a pattern for QMLdir files. (Amaan Qureshi, closes vim/vim#12161 )
https://github.com/vim/vim/commit/1505bef5c482a48e704644e6172be91c07ef1d12
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com >
2023-03-17 10:06:56 +01:00
Christian Clason and Amaan Qureshi
d7746b6ef1
vim-patch:9.0.1407: TableGen files are not recognized
...
Problem: TableGen files are not recognized.
Solution: Add a pattern for TableGen files. (Amaan Qureshi, closes vim/vim#12156 )
https://github.com/vim/vim/commit/b8ef029ee416fc2b402c3f321a55c9049b0ad2a9
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com >
2023-03-17 09:41:54 +01:00