Skip to content

Commit

Permalink
support more annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
oysandvik94 committed Sep 17, 2024
1 parent 1e7d1b3 commit 21aef5e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lua/curl/java.lua
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ local M = {}
---@param arg_node TSNode
local function parse_annotation_arguments(arg_node, key)
for node, _ in arg_node:iter_children() do
if node:type() == "string_literal" then
return vim.treesitter.get_node_text(node, 0):gsub('"', "")
end
if node:type() == "element_value_pair" then
for pair_node, field in node:iter_children() do
if field == "key" then
Expand Down Expand Up @@ -62,6 +65,10 @@ local function parse_annotation(annotation_node)

if field == "arguments" then
path = parse_annotation_arguments(node, "path")

if path == nil then
path = parse_annotation_arguments(node, "value")
end
end
end

Expand Down

0 comments on commit 21aef5e

Please sign in to comment.