Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lua/hidesig.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function M.init()
hidesig = {
module_path = "hidesig.main",
is_supported = function(lang)
local isSupported = queries.get_query(lang, "sig_def") ~= nil
local isSupported = queries.get_query(lang, "sorbet") ~= nil
return isSupported
end,
opacity = 0.75
Expand Down
4 changes: 2 additions & 2 deletions lua/hidesig/internal.lua
Original file line number Diff line number Diff line change
Expand Up @@ -68,15 +68,15 @@ function hidesig.highlightLines(bufnr, range, tree, lang, opacity)
end

local rootNode = tree:root()
local parsedQuery = ts_query.get_query(lang, "sig_def")
local parsedQuery = ts_query.get_query(lang, "sorbet")

local startRow = range[1]
local endRow = range[2]

vim.api.nvim_buf_clear_namespace(bufnr, namespace, startRow, endRow)

for _, captures in parsedQuery:iter_matches(rootNode, bufnr, startRow, endRow) do
local sigBlock = captures[2] -- capture @sig_def
local sigBlock = captures[2] -- capture @sorbet

if sigBlock ~= nil and not sigBlock:has_error() then
for rootChildNode in sigBlock:iter_children() do
Expand Down
6 changes: 0 additions & 6 deletions queries/ruby/sig_def.scm

This file was deleted.

17 changes: 17 additions & 0 deletions queries/ruby/sorbet.scm
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
(
call
method: (identifier) @sig_keyword
block: [(block) (do_block)]
(#eq? @sig_keyword "sig")
) @sorbet

(
assignment
left: (constant)
right: (
call
receiver: (constant)
method: (identifier) @alias_identifier
(#eq? @alias_identifier "type_alias")
)
) @sorbet