Skip to content

Commit

Permalink
feat: Handle variables in Makefiles - closes #37
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewferrier committed Nov 6, 2023
1 parent eccb661 commit 52c82f6
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lua/debugprint/utils.lua
Expand Up @@ -27,6 +27,7 @@ M.find_treesitter_variable = function()
return nil
else
local node_type = node:type()
local parent_node_type = node:parent():type()

local variable_name

Expand All @@ -41,10 +42,12 @@ M.find_treesitter_variable = function()
-- lua, typescript -> identifier
-- sh -> variable_name
-- typescript -> shorthand_property_identifier_pattern (see issue #60)
-- Makefile -> variable_reference
if
node_type == "identifier"
or node_type == "variable_name"
or node_type == "shorthand_property_identifier_pattern"
or parent_node_type == "variable_reference"
then
return variable_name
else
Expand Down

0 comments on commit 52c82f6

Please sign in to comment.