tstree.lua 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. ---@meta
  2. -- luacheck: no unused args
  3. error('Cannot require a meta file')
  4. --- @brief A "treesitter tree" represents the parsed contents of a buffer, which can be
  5. --- used to perform further analysis. It is a |userdata| reference to an object
  6. --- held by the treesitter library.
  7. ---
  8. --- An instance `TSTree` of a treesitter tree supports the following methods.
  9. ---@nodoc
  10. ---@class TSTree: userdata
  11. local TSTree = {} -- luacheck: no unused
  12. --- Return the root node of this tree.
  13. ---@return TSNode
  14. function TSTree:root() end
  15. -- stylua: ignore
  16. ---@param start_byte integer
  17. ---@param end_byte_old integer
  18. ---@param end_byte_new integer
  19. ---@param start_row integer
  20. ---@param start_col integer
  21. ---@param end_row_old integer
  22. ---@param end_col_old integer
  23. ---@param end_row_new integer
  24. ---@param end_col_new integer
  25. ---@nodoc
  26. function TSTree:edit(start_byte, end_byte_old, end_byte_new, start_row, start_col, end_row_old, end_col_old, end_row_new, end_col_new) end
  27. --- Returns a copy of the `TSTree`.
  28. ---@return TSTree
  29. function TSTree:copy() end
  30. ---@param include_bytes true
  31. ---@return Range6[]
  32. ---@nodoc
  33. function TSTree:included_ranges(include_bytes) end
  34. ---@param include_bytes false
  35. ---@return Range4[]
  36. ---@nodoc
  37. function TSTree:included_ranges(include_bytes) end