Commit Graph
1361 Commits
Author SHA1 Message Date
bfredl 39096f48f0 Merge pull request #13834 from bfredl/omnilua
omnifunc for builtin lua
2023-03-07 00:28:53 +01:00
Björn Linse 79571b92ce feat(lua): omnifunc for builting lua interpreter
also make implicit submodules "uri" and "_inspector" work with completion

this is needed for `:lua=vim.uri_<tab>` wildmenu completion
to work even before uri or _inspector functions are used.
2023-03-06 23:12:21 +01:00
swarn 1cc23e1109 feat(lsp)!: add rule-based sem token highlighting (#22022)
feat(lsp)!: change semantic token highlighting

Change the default highlights used, and add more highlights per token.

Add an LspTokenUpdate event and a highlight_token function.

:Inspect now shows any highlights applied by token highlighting rules,
default or user-defined.

BREAKING CHANGE: change the default highlight groups used by semantic
token highlighting.
2023-03-06 19:03:13 +01:00
Justin M. Keyes 74ffebf8ec fix(vim.version): incorrect version.cmp()
Problem:
If major<major but minor>minor, cmp_version_core returns 1

Solution:
- Fix logic in cmp_version_core
- Delete most eq()/gt()/lt() tests, they are redundant.
2023-03-06 15:36:25 +01:00
Justin M. Keyes e31e49a8e3 refactor(vim.version): cleanup
- version.cmp(): assert valid version
- add test for loading vim.version (the other tests use shared.lua in
  the test runner)
- reduce test scopes, reword test descriptions
2023-03-06 14:51:56 +01:00
Kelly Lin 0e7196438d feat(lua): add semver api 2023-03-06 13:45:59 +01:00
Lewis Russell f9a46391ab refactor(treesitter): simplify some range functions 2023-03-06 10:57:14 +00:00
Justin M. Keyes 533d671271 docs: module-level docstrings (@defgroup) #22498
Problem:
gen_vimdoc.py / lua2dox.lua does not support @defgroup or \defgroup
except for "api-foo" modules.

Solution:
Modify `gen_vimdoc.py` to look for section names based on `helptag_fmt`.

TODO:
- Support @module ?
  https://github.com/LuaLS/lua-language-server/wiki/Annotations#module
2023-03-05 15:15:29 -08:00
Mathias Fußenegger ed05d38d9f fix(lsp): don't monitor files if workspace_folders is nil (#22531)
Fixes:

    Error SERVER_REQUEST_HANDLER_ERROR: "...di/dev/neovim/neovim/runtime/lua/vim/lsp/_watchfiles.lua
    :200: bad argument #1 to 'ipairs' (table expected, got nil)"

Language servers can be started without root_dir or workspace_folders.
2023-03-05 08:42:15 +01:00
Jon Huhn ac69ba5fa0 feat(lsp): implement workspace/didChangeWatchedFiles (#22405) 2023-03-05 07:52:27 +01:00
Jaehwang Jung 59542504b4 docs(highlight): fix type annotations (#22272) 2023-03-04 17:47:30 +01:00
Jaehwang Jung aa16590999 docs(lua): number → integer (#22517) 2023-03-04 13:07:39 +00:00
Jaehwang Jung 82b77900d7 docs(diagnostic): number → integer (#22512) 2023-03-04 13:06:20 +00:00
Jaehwang Jung 1f07307aeb docs(inspect): number → integer (#22511) 2023-03-04 13:05:46 +00:00
Jaehwang Jung ccd2cc1abd docs(uri): number → integer (#22515) 2023-03-04 13:05:16 +00:00
Jaehwang Jung 6a20c29dcd docs(filetype): number → integer (#22516) 2023-03-04 13:05:01 +00:00
Jaehwang Jung 128b82103b docs(treesitter): number → integer (#22513) 2023-03-04 13:04:05 +00:00
Gregory Anders bf90ceb548 fix(treesitter): break early from loop when match is found (#22499)
Fixup to #22484.
2023-03-03 07:52:57 -07:00
Justin M. Keyes 8414cfe7f4 docs: fix vim.treesitter tags
Problem:
Help tags like vim.treesitter.language.add() are confusing because
`vim.treesitter.language` is (thankfully) not a user-facing module.

Solution:
Ignore the "fstem" when generating "treesitter" tags.
2023-03-03 15:07:23 +01:00
Christian Clason 74c9c413e7 Merge pull request #22484 from gpanders/inspect-tree-fix-cursor
fix(treesitter): maintain cursor position when toggling anonymous nodes
2023-03-03 14:19:09 +01:00
Jaehwang Jung f0a2ffab29 fix(treesitter): typos in _range.lua
fix(treesitter): typos _range.lua
2023-03-03 11:05:59 +00:00
Lewis Russell 6d4f481821 fix(treesitter): disallow empty filetypes
Fixes #22473
2023-03-03 09:44:02 +00:00
Amaan Qureshi fdb6b4d2e7 vim-patch:9.0.1368: Bass files are not recognized (#22485)
Problem:    Bass files are not recognized.
Solution:   Add patterns for Bass files. (Amaan Qureshi, closes vim/vim#12088)

https://github.com/vim/vim/commit/4ed914b18a47192f79f342bea5e8f59e120d5260
2023-03-02 23:29:03 +01:00
Gregory Anders 86ff239240 refactor(treesitter): use string.format to create lines 2023-03-02 14:15:18 -07:00
Gregory Anders 2eeafc43c4 fix(treesitter): maintain cursor position when toggling anonymous nodes
When toggling anonymous nodes in the :InspectTree window, keep the
cursor fixed relative to the node within the tree. This prevents the
cursor from jumping.
2023-03-02 14:11:15 -07:00
Christian Clason f449121764 feat(treesitter): add :InspectTree command (#22477) 2023-03-02 18:03:11 +01:00
Justin M. Keyes b0b4c31097 refactor: rename show_tree => inspect_tree #22474
Problem:
"show" is potentially a new verb that we can avoid (there is already
"open" and "echo"). Even if we can't avoid it, the behavior of
`show_tree` fits well in the "inspect" family of functions: a way for
users to introspect/reflect on the state of Nvim.

Existing "inspect" functions:
    vim.inspect()
    vim.inspect_pos()
    vim.treesitter.inspect_language()
    nvim__inspect_cell

Solution:
Rename `show_tree` to `inspect_tree`.
2023-03-02 07:01:42 -08:00
Mike bc15b075d1 feat(vim.fs): pass path to find() predicate, lazy evaluate #22378
Problem:
No easy way to find files under certain directories (ex: grab all files under
`test/`) or exclude the content of certain paths (ex. `build/`, `.git/`)

Solution:
Pass the full `path` as an arg to the predicate.
2023-03-01 08:51:22 -08:00
Gregory Anders 014981c900 fix(lsp): only fire LspDetach for attached buffers (#22468)
If the LSP server fails to start then the client never initializes and
thus never calls its on_attach function and an LspAttach event is
never fired. However, the on_exit function still fires a LspDetach
event, so user autocommands that attempt to "clean up" in LspDetach may
run into problems if they assume that the buffer was already attached.

The solution is to only fire an LspDetach event if the buffer was
already attached in the first place.
2023-03-01 17:47:56 +01:00
Mathias Fußenegger 896d672736 fix(lsp): use buffer scheme for files not stored on disk (#22407)
Sending `didOpen` with a `file` scheme causes problems with some
language servers because they expect the file to exist on disk.

See https://github.com/microsoft/language-server-protocol/pull/1679
2023-03-01 15:33:13 +01:00
Jens Claes 96d3616a53 fix(lsp): callHierarchy methods also require the callHierarchyProvider (#22427) 2023-03-01 11:35:16 +01:00
bfredl 011b4c5c62 Merge pull request #22452 from folke/master
fix(inspect): always resolve full treesitter lang hl groups
2023-02-28 14:13:01 +01:00
bfredl 7e19cabeb1 perf(lsp): only redraw the windows containing LSP tokens
redraw! redraws the entire screen instead of just the windows with
the buffer which were actually changed.

I considered trying to calculating the range for the delta
but it looks tricky. Could a follow-up.
2023-02-28 13:11:36 +01:00
Folke Lemaitre 7574d58304 fix(inspect): alwasy resolve full treesitter lang hl groups 2023-02-28 12:12:08 +01:00
Mike f89e3497c8 docs(lsp): update cmd_env description (#22438) 2023-02-27 21:19:41 +01:00
Amaan Qureshi 2a8e6a2f1a vim-patch:9.0.1360: Cue files are not recognized (#22439)
Problem:    Cue files are not recognized.
Solution:   Add patterns for Cue files. (Amaan Qureshi, closes vim/vim#12067)

https://github.com/vim/vim/commit/80c5b2c0f78b24e52c73bb162dda3ad85acd7e82
2023-02-27 21:08:31 +01:00
Lewis Russell f64098a2df fix(treesitter): fixup for health 2023-02-27 15:33:18 +00:00
Lewis Russell 5aa37e20e0 fix(treesitter): ipairs -> pairs
Fixes: https://github.com/nvim-treesitter/nvim-treesitter/issues/4349
2023-02-27 15:01:09 +00:00
Lewis Russell da56f06037 fix(treesitter): remove virtual text from playground
Implement the range and lang annotations as comments instead
2023-02-27 10:49:19 +00:00
Lewis Russell 774e59f3f9 feat(treesitter): expand the API 2023-02-26 16:53:33 +00:00
Mathias Fußenegger c1514d7e67 fix(lsp): fix some type annotations (#22397) 2023-02-25 18:47:05 +01:00
Mathias Fussenegger f0f27e9aef Revert "feat(lsp): implement workspace/didChangeWatchedFiles (#21293)"
This reverts commit 5732aa706c.

Causes editor to freeze in projects with many watcher registrations
2023-02-25 11:17:28 +01:00
Jon Huhn 5732aa706c feat(lsp): implement workspace/didChangeWatchedFiles (#21293) 2023-02-25 10:07:18 +01:00
Christian ClasonandAmaan Qureshi 15cce77b38 vim-patch:9.0.1351: Dhall files are not recognized (#22393)
Problem:    Dhall files are not recognized.
Solution:   Add patterns for Dhall files. (Amaan Qureshi, closes vim/vim#12052)

https://github.com/vim/vim/commit/def5521752abefe12db8cc3111a3b205ad1ac929

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-24 17:50:37 +01:00
Christian ClasonandAmaan Qureshi 4297127f14 vim-patch:9.0.1350: CPON files are not recognized (#22392)
Problem:    CPON files are not recognized.
Solution:   Add patterns for CPON files. (Amaan Qureshi, closes vim/vim#12053)

https://github.com/vim/vim/commit/c2254764bcada43eea894eb5852a26d5ac5ca8b0

Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
2023-02-24 15:34:52 +01:00
Raphael 1803dadb20 refactor(lsp): remove deprecated code (#22389) 2023-02-24 12:55:50 +01:00
Lewis Russell c57af5d41c feat(treesitter)!: remove silent option from language.add()
Simply use `pcall` if you want to silence an error.
2023-02-24 09:50:59 +00:00
Amaan Qureshi 5e1308b7ca vim-patch:9.0.1348: Un-grammar files are not recognized (#22383)
Problem:    Un-grammar files are not recognized.
Solution:   Add patterns for Un-grammar files. (Amaan Qureshi, closes vim/vim#12034)

https://github.com/vim/vim/commit/44e08c1cf83f5a50f8b21613551304a6651c1161
2023-02-23 22:12:01 +01:00
Lewis Russell 3f35ebb14d fix(treesitter): fixup language invalidation (#22381) 2023-02-23 18:09:44 +00:00
Lewis Russell 1df3f5ec6a feat(treesitter): upstream foldexpr from nvim-treesitter 2023-02-23 17:05:20 +00:00