Skip to content

Commit 52c82f6

Browse files
committed
feat: Handle variables in Makefiles - closes #37
1 parent eccb661 commit 52c82f6

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

lua/debugprint/utils.lua

+3
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ M.find_treesitter_variable = function()
2727
return nil
2828
else
2929
local node_type = node:type()
30+
local parent_node_type = node:parent():type()
3031

3132
local variable_name
3233

@@ -41,10 +42,12 @@ M.find_treesitter_variable = function()
4142
-- lua, typescript -> identifier
4243
-- sh -> variable_name
4344
-- typescript -> shorthand_property_identifier_pattern (see issue #60)
45+
-- Makefile -> variable_reference
4446
if
4547
node_type == "identifier"
4648
or node_type == "variable_name"
4749
or node_type == "shorthand_property_identifier_pattern"
50+
or parent_node_type == "variable_reference"
4851
then
4952
return variable_name
5053
else

0 commit comments

Comments
 (0)