| Commit message (Collapse) | Author | Age |
|
|
| |
Fixup to #22484.
|
|
|
|
|
|
|
|
|
| |
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.
|
|\
| |
| | |
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.
|
| |
| |
| | |
fix(treesitter): typos _range.lua
|
| |
| |
| | |
Fixes #22473
|
|/
|
|
|
|
| |
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
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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`.
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
| |
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(inspect): always resolve full treesitter lang hl groups
|
| | |
|
|/
|
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
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
|
| |
|
|
|
| |
Fixes: https://github.com/nvim-treesitter/nvim-treesitter/issues/4349
|
|
|
| |
Implement the range and lang annotations as comments instead
|
| |
|
| |
|
|
|
|
|
|
| |
This reverts commit 5732aa706c639b3d775573d91d1139f24624629c.
Causes editor to freeze in projects with many watcher registrations
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
| |
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>
|
| |
|
|
|
| |
Simply use `pcall` if you want to silence an error.
|
|
|
|
|
|
| |
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
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
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>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
| |
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| | |
close #21063
|
|/
|
|
|
|
|
|
|
|
|
|
| |
This function replaces both vim.treesitter.get_node_at_pos() and
vim.treesitter.get_node_at_cursor(). These two functions are similar
enough that they don't need separate interfaces. Even worse,
get_node_at_pos() returns a TSNode while get_node_at_cursor() returns a
string, so the two functions behave slightly differently.
vim.treesitter.get_node() combines these two into a more streamlined
interface. With no arguments, it returns the node under the cursor in
the current buffer. Optionally, it can accept a buffer number or a
position to get the node at a given position in a given buffer.
|
|
|
|
|
|
|
|
|
| |
Problem: Yuck files are not recognized.
Solution: Add a filetype pattern for yuck files. (Amaan Qureshi,
closes vim/vim#12033)
https://github.com/vim/vim/commit/cfce5cf542db20c7beba5b4211c0ae3305a64a43
Co-authored-by: Amaan Qureshi <amaanq12@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Problem:
vim.treesitter does not know how to map a specific filetype to a parser.
This creates problems since in a few places (including in vim.treesitter itself), the filetype is incorrectly used in place of lang.
Solution:
Add an API to enable this:
- Add vim.treesitter.language.add() as a replacement for vim.treesitter.language.require_language().
- Optional arguments are now passed via an opts table.
- Also takes a filetype (or list of filetypes) so we can keep track of what filetypes are associated with which langs.
- Deprecated vim.treesitter.language.require_language().
- Add vim.treesitter.language.get_lang() which returns the associated lang for a given filetype.
- Add vim.treesitter.language.register() to associate filetypes to a lang without loading the parser.
|
| |
|
|
|
|
|
|
|
|
|
| |
Problem: PRQL files are not recognized.
Solution: Add a filetype pattern for PRQL files. (Matthias Queitsch,
closes vim/vim#12018)
https://github.com/vim/vim/commit/9de960ace0f017fcfeaf64a2f6492f0f88b11fdb
Co-authored-by: Matthias Queitsch <matthias.queitsch@mailbox.org>
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The original motivation for this change came from developping
https://github.com/neovim/neovim/pull/22159, which will require adding
more autocommand creation to Neovim's startup sequence.
This change requires lightly editing a test that expected no autocommand
to have been created from lua.
|
| |
| |
| |
| |
| |
| | |
If nothing matched in match_from_hashbang, also check the file extension table.
For a hashbang like '#!/bin/env foo', this will set the filetype to 'fooscript'
assuming the filetype for the 'foo' extension is 'fooscript' in the extension
table.
|