aboutsummaryrefslogtreecommitdiff
path: root/runtime/lua/vim
Commit message (Collapse)AuthorAge
* feat(lsp)!: add rule-based sem token highlighting (#22022)swarn2023-03-06
| | | | | | | | | | | | | 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.
* fix(vim.version): incorrect version.cmp()Justin M. Keyes2023-03-06
| | | | | | | | | 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.
* refactor(vim.version): cleanupJustin M. Keyes2023-03-06
| | | | | | | - 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
* feat(lua): add semver apiKelly Lin2023-03-06
|
* refactor(treesitter): simplify some range functionsLewis Russell2023-03-06
|
* docs: module-level docstrings (@defgroup) #22498Justin M. Keyes2023-03-05
| | | | | | | | | | | | 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
* fix(lsp): don't monitor files if workspace_folders is nil (#22531)Mathias Fußenegger2023-03-05
| | | | | | | | 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.
* feat(lsp): implement workspace/didChangeWatchedFiles (#22405)Jon Huhn2023-03-05
|
* docs(highlight): fix type annotations (#22272)Jaehwang Jung2023-03-04
|
* docs(lua): number → integer (#22517)Jaehwang Jung2023-03-04
|
* docs(diagnostic): number → integer (#22512)Jaehwang Jung2023-03-04
|
* docs(inspect): number → integer (#22511)Jaehwang Jung2023-03-04
|
* docs(uri): number → integer (#22515)Jaehwang Jung2023-03-04
|
* docs(filetype): number → integer (#22516)Jaehwang Jung2023-03-04
|
* docs(treesitter): number → integer (#22513)Jaehwang Jung2023-03-04
|
* fix(treesitter): break early from loop when match is found (#22499)Gregory Anders2023-03-03
| | | Fixup to #22484.
* docs: fix vim.treesitter tagsJustin M. Keyes2023-03-03
| | | | | | | | | 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.
* Merge pull request #22484 from gpanders/inspect-tree-fix-cursorChristian Clason2023-03-03
|\ | | | | fix(treesitter): maintain cursor position when toggling anonymous nodes
| * refactor(treesitter): use string.format to create linesGregory Anders2023-03-02
| |
| * fix(treesitter): maintain cursor position when toggling anonymous nodesGregory Anders2023-03-02
| | | | | | | | | | | | 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.
* | fix(treesitter): typos in _range.luaJaehwang Jung2023-03-03
| | | | | | fix(treesitter): typos _range.lua
* | fix(treesitter): disallow empty filetypesLewis Russell2023-03-03
| | | | | | Fixes #22473
* | vim-patch:9.0.1368: Bass files are not recognized (#22485)Amaan Qureshi2023-03-02
|/ | | | | | 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
* feat(treesitter): add :InspectTree command (#22477)Christian Clason2023-03-02
|
* refactor: rename show_tree => inspect_tree #22474Justin M. Keyes2023-03-02
| | | | | | | | | | | | | | | | 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`.
* feat(vim.fs): pass path to find() predicate, lazy evaluate #22378Mike2023-03-01
| | | | | | | | 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.
* fix(lsp): only fire LspDetach for attached buffers (#22468)Gregory Anders2023-03-01
| | | | | | | | | | 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.
* fix(lsp): use buffer scheme for files not stored on disk (#22407)Mathias Fußenegger2023-03-01
| | | | | | 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
* fix(lsp): callHierarchy methods also require the callHierarchyProvider (#22427)Jens Claes2023-03-01
|
* Merge pull request #22452 from folke/masterbfredl2023-02-28
|\ | | | | fix(inspect): always resolve full treesitter lang hl groups
| * fix(inspect): alwasy resolve full treesitter lang hl groupsFolke Lemaitre2023-02-28
| |
* | perf(lsp): only redraw the windows containing LSP tokensbfredl2023-02-28
|/ | | | | | | | 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.
* docs(lsp): update cmd_env description (#22438)Mike2023-02-27
|
* vim-patch:9.0.1360: Cue files are not recognized (#22439)Amaan Qureshi2023-02-27
| | | | | | 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
* fix(treesitter): fixup for healthLewis Russell2023-02-27
|
* fix(treesitter): ipairs -> pairsLewis Russell2023-02-27
| | | Fixes: https://github.com/nvim-treesitter/nvim-treesitter/issues/4349
* fix(treesitter): remove virtual text from playgroundLewis Russell2023-02-27
| | | Implement the range and lang annotations as comments instead
* feat(treesitter): expand the APILewis Russell2023-02-26
|
* fix(lsp): fix some type annotations (#22397)Mathias Fußenegger2023-02-25
|
* Revert "feat(lsp): implement workspace/didChangeWatchedFiles (#21293)"Mathias Fussenegger2023-02-25
| | | | | | This reverts commit 5732aa706c639b3d775573d91d1139f24624629c. Causes editor to freeze in projects with many watcher registrations
* feat(lsp): implement workspace/didChangeWatchedFiles (#21293)Jon Huhn2023-02-25
|
* vim-patch:9.0.1351: Dhall files are not recognized (#22393)Christian Clason2023-02-24
| | | | | | | | 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>
* vim-patch:9.0.1350: CPON files are not recognized (#22392)Christian Clason2023-02-24
| | | | | | | | 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>
* refactor(lsp): remove deprecated code (#22389)Raphael2023-02-24
|
* feat(treesitter)!: remove silent option from language.add()Lewis Russell2023-02-24
| | | Simply use `pcall` if you want to silence an error.
* vim-patch:9.0.1348: Un-grammar files are not recognized (#22383)Amaan Qureshi2023-02-23
| | | | | | 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
* fix(treesitter): fixup language invalidation (#22381)Lewis Russell2023-02-23
|
* feat(treesitter): upstream foldexpr from nvim-treesitterLewis Russell2023-02-23
|
* vim-patch:9.0.1346: Starlark files are not recognized (#22380)Christian Clason2023-02-23
| | | | | | | | Problem: Starlark files are not recognized. Solution: Add patterns for Starlark files. (Amaan Qureshi, closes vim/vim#12049) https://github.com/vim/vim/commit/ca06b30073de22dc120b532e90fbee2a10ef9772 Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
* perf(treesitter): smarter languagetree invalidationLewis Russell2023-02-23
| | | | | | | | | | | | | | Problem: Treesitter injections are slow because all injected trees are invalidated on every change. Solution: Implement smarter invalidation to avoid reparsing injected regions. - In on_bytes, try and update self._regions as best we can. This PR just offsets any regions after the change. - Add valid flags for each region in self._regions. - Call on_bytes recursively for all children. - We still need to run the query every time for the top level tree. I don't know how to avoid this. However, if the new injection ranges don't change, then we re-use the old trees and avoid reparsing children. This should result in roughly a 2-3x reduction in tree parsing when the comment injections are enabled.