@@ -391,8 +391,23 @@ function parser.parse(node, source, ctx)
391391 end
392392 elseif child_type == " request_separator" then
393393 name = get_node_field_text (child , " value" , source )
394- elseif child_type == " comment" and get_node_field_text (child , " name" , source ) == " name" then
395- name = get_node_field_text (child , " value" , source ) or name
394+ elseif child_type == " comment" and child :field (" name" )[1 ] then
395+ local comment_name = get_node_field_text (child , " name" , source )
396+ local comment_value = get_node_field_text (child , " value" , source )
397+ if comment_name == " name" then
398+ name = comment_value or name
399+ elseif comment_name == " prompt" and comment_value then
400+ local var_name , var_description = comment_value :match (" (%S+)%s*(.*)" )
401+ if var_description == " " then
402+ var_description = nil
403+ end
404+ vim .ui .input ({
405+ prompt = (var_description or (" Enter value for `%s`" ):format (var_name )) .. " : " ,
406+ default = ctx :resolve (var_name ),
407+ }, function (input )
408+ ctx :set_local (var_name , input )
409+ end )
410+ end
396411 elseif child_type == " variable_declaration" then
397412 parser .parse_variable_declaration (child , source , ctx )
398413 end
0 commit comments