fix: typos

This commit is contained in:
Oleksandr Smirnov 2025-03-05 16:22:00 +02:00
parent b580829379
commit fec8a74fe3
No known key found for this signature in database
3 changed files with 8 additions and 12 deletions

View file

@ -91,7 +91,7 @@ do
local log_at_level = function(level_config, message_maker, ...) local log_at_level = function(level_config, message_maker, ...)
-- Return early if we're below the current_log_level -- Return early if we're below the current_log_level
-- --
-- the log level source get from config directly because otherwise it doesnt work -- the log level source get from config directly because otherwise it doesn't work
if level_config.level < c.log_level then if level_config.level < c.log_level then
return return
end end

View file

@ -28,7 +28,7 @@ end
---@return string[]|nil ---@return string[]|nil
function gocmd.run(subcmd, args) function gocmd.run(subcmd, args)
if #args == 0 then if #args == 0 then
error "please provice any arguments" error "please provide any arguments"
end end
if subcmd == "get" then if subcmd == "get" then
@ -45,7 +45,7 @@ function gocmd.run(subcmd, args)
if status ~= 0 then if status ~= 0 then
error("gocmd failed: " .. data) error("gocmd failed: " .. data)
end end
u.notify(c.go .. " " .. subcmd .. " successful runned") u.notify(c.go .. " " .. subcmd .. " ran successful")
end, end,
}) })
end end

View file

@ -2,7 +2,7 @@
local nodes = require "gopher._utils.ts.nodes" local nodes = require "gopher._utils.ts.nodes"
local u = require "gopher._utils" local u = require "gopher._utils"
local ts = { local ts = {
querys = { queries = {
struct_block = [[((type_declaration (type_spec name:(type_identifier) @struct.name type: (struct_type)))@struct.declaration)]], struct_block = [[((type_declaration (type_spec name:(type_identifier) @struct.name type: (struct_type)))@struct.declaration)]],
em_struct_block = [[(field_declaration name:(field_identifier)@struct.name type: (struct_type)) @struct.declaration]], em_struct_block = [[(field_declaration name:(field_identifier)@struct.name type: (struct_type)) @struct.declaration]],
package = [[(package_clause (package_identifier)@package.name)@package.clause]], package = [[(package_clause (package_identifier)@package.name)@package.clause]],
@ -25,10 +25,9 @@ end
---@param row string ---@param row string
---@param col string ---@param col string
---@param bufnr string|nil ---@param bufnr string|nil
---@param do_notify boolean|nil
---@return table|nil ---@return table|nil
function ts.get_struct_node_at_pos(row, col, bufnr) function ts.get_struct_node_at_pos(row, col, bufnr)
local query = ts.querys.struct_block .. " " .. ts.querys.em_struct_block local query = ts.queries.struct_block .. " " .. ts.queries.em_struct_block
local bufn = bufnr or vim.api.nvim_get_current_buf() local bufn = bufnr or vim.api.nvim_get_current_buf()
local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col) local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col)
if ns == nil then if ns == nil then
@ -41,10 +40,9 @@ end
---@param row string ---@param row string
---@param col string ---@param col string
---@param bufnr string|nil ---@param bufnr string|nil
---@param do_notify boolean|nil
---@return table|nil ---@return table|nil
function ts.get_func_method_node_at_pos(row, col, bufnr) function ts.get_func_method_node_at_pos(row, col, bufnr)
local query = ts.querys.func .. " " .. ts.querys.method_name local query = ts.queries.func .. " " .. ts.queries.method_name
local bufn = bufnr or vim.api.nvim_get_current_buf() local bufn = bufnr or vim.api.nvim_get_current_buf()
local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col) local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col)
if ns == nil then if ns == nil then
@ -57,13 +55,12 @@ end
---@param row string ---@param row string
---@param col string ---@param col string
---@param bufnr string|nil ---@param bufnr string|nil
---@param do_notify boolean|nil
---@return table|nil ---@return table|nil
function ts.get_package_node_at_pos(row, col, bufnr) function ts.get_package_node_at_pos(row, col, bufnr)
if row > 10 then if row > 10 then
return return
end end
local query = ts.querys.package local query = ts.queries.package
local bufn = bufnr or vim.api.nvim_get_current_buf() local bufn = bufnr or vim.api.nvim_get_current_buf()
local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col) local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col)
if ns == nil then if ns == nil then
@ -76,10 +73,9 @@ end
---@param row string ---@param row string
---@param col string ---@param col string
---@param bufnr string|nil ---@param bufnr string|nil
---@param do_notify boolean|nil
---@return table|nil ---@return table|nil
function ts.get_interface_node_at_pos(row, col, bufnr) function ts.get_interface_node_at_pos(row, col, bufnr)
local query = ts.querys.interface local query = ts.queries.interface
local bufn = bufnr or vim.api.nvim_get_current_buf() local bufn = bufnr or vim.api.nvim_get_current_buf()
local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col) local ns = nodes.nodes_at_cursor(query, get_name_defaults(), bufn, row, col)
if ns == nil then if ns == nil then