Skip to content

Commit

Permalink
Merge pull request #56 from mistweaverco/feat/fix-document-variables
Browse files Browse the repository at this point in the history
fix(parser): document variables with underscores
  • Loading branch information
gorillamoe authored Jul 15, 2024
2 parents 6a7534a + a5e6fe9 commit 3f296d4
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion lua/kulala/globals/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ local FS = require("kulala.utils.fs")

local M = {}

M.VERSION = "2.2.0"
M.VERSION = "2.2.1"
M.UI_ID = "kulala://ui"
M.HEADERS_FILE = FS.get_plugin_tmp_dir() .. "/headers.txt"
M.BODY_FILE = FS.get_plugin_tmp_dir() .. "/body.txt"
Expand Down
4 changes: 2 additions & 2 deletions lua/kulala/parser/init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,11 @@ M.get_document = function()
if is_request_line == false then
is_body_section = true
end
elseif line:match("^@%w+") then
elseif line:match("^@([%w_]+)") then
-- Variable
-- Variables are defined as `@variable_name=value`
-- The value can be a string, a number or boolean
local variable_name, variable_value = line:match("^%@(%w+)%s*=%s*(.*)$")
local variable_name, variable_value = line:match("^@([%w_]+)%s*=%s*(.*)$")
if variable_name and variable_value then
-- remove the @ symbol from the variable name
variable_name = variable_name:sub(1)
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"name": "kulala.nvim",
"version": "2.2.0"
"version": "2.2.1"
}

0 comments on commit 3f296d4

Please sign in to comment.