refactor(utils): move import into functions
This commit is contained in:
parent
eb927bc19b
commit
ebf697b80a
2 changed files with 10 additions and 8 deletions
|
|
@ -1,7 +1,3 @@
|
|||
local ts_query = require "nvim-treesitter.query"
|
||||
local parsers = require "nvim-treesitter.parsers"
|
||||
local locals = require "nvim-treesitter.locals"
|
||||
local u = require "gopher._utils"
|
||||
local M = {}
|
||||
|
||||
local function intersects(row, col, sRow, sCol, eRow, eCol)
|
||||
|
|
@ -57,6 +53,10 @@ end
|
|||
---@param pos_row string
|
||||
---@return string
|
||||
function M.get_all_nodes(query, lang, _, bufnr, pos_row, _)
|
||||
local ts_query = require "nvim-treesitter.query"
|
||||
local parsers = require "nvim-treesitter.parsers"
|
||||
local locals = require "nvim-treesitter.locals"
|
||||
|
||||
bufnr = bufnr or 0
|
||||
pos_row = pos_row or 30000
|
||||
|
||||
|
|
@ -113,6 +113,8 @@ end
|
|||
---@param col string
|
||||
---@return table
|
||||
function M.nodes_at_cursor(query, default, bufnr, row, col)
|
||||
local u = require "gopher._utils"
|
||||
|
||||
bufnr = bufnr or vim.api.nvim_get_current_buf()
|
||||
local ft = vim.api.nvim_buf_get_option(bufnr, "ft")
|
||||
if row == nil or col == nil then
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue