You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This takes the range of the captured node and applies an offset. However if you apply a row offset the column will generally need to be changed.
This code does not update the column. Probably because it is hard to decide what the column should be, what should it be when the row is increased with the offset?
This is not mentioned in the docs (version: 0.5), I think it might be helpful if it is. Can I open a PR updating the docs @steelsojka?
The text was updated successfully, but these errors were encountered:
from this comment nvim-treesitter/playground#58 (comment) it seems that offset! is only at temporary measure. If so I it should be marked as such to prevent plugin authors such as my self from relying on it.
Well, it is temporary in a way that we wanted to have a more generalized solution. But it should be made clear that it offset! is a very specialized solution that at the moment only works for injections. A more generalized offset! and a protocol to write other predicate other directives that modify ranges would be a more sustainable long-term solution.
offset! was merged under the premised that it will be generalized in follow-up PR. But it stayed the way it was because it is apparently working. It is however difficult to explain to users why they can't use offset! in other type of queries.
relevant piece of code:
neovim/runtime/lua/vim/treesitter/query.lua
Line 308 in 6acebb8
This takes the range of the captured node and applies an offset. However if you apply a row offset the column will generally need to be changed.
This code does not update the column. Probably because it is hard to decide what the column should be, what should it be when the row is increased with the offset?
This is not mentioned in the docs (version: 0.5), I think it might be helpful if it is. Can I open a PR updating the docs @steelsojka?
The text was updated successfully, but these errors were encountered: