introduce symbol scope, use for elixir private

fixes #225
This commit is contained in:
Emmanuel Touzery 2023-03-18 14:55:50 +01:00
parent 5b788392ec
commit aad9d05b8c
3 changed files with 5 additions and 0 deletions

View file

@ -72,6 +72,9 @@ M.elixir = {
local identifier = (utils.get_at_path(match, "identifier") or {}).node
if identifier then
local name = vim.treesitter.query.get_node_text(identifier, bufnr) or "<parse error>"
if name == "defp" then
item.scope = "private"
end
item.kind = M.elixir.kind_map[name] or item.kind
if name == "callback" and item.parent then
item.parent.kind = "Interface"

View file

@ -14,6 +14,7 @@ local config = require("aerial.config")
---@field parent? aerial.Symbol
---@field selection_range? aerial.Range
---@field children? aerial.Symbol[]
---@field scope? string
---@class aerial.BufData
---@field bufnr integer

View file

@ -34,6 +34,7 @@ describe("treesitter elixir", function()
kind = "Function",
name = "private_function",
level = 1,
scope = "private",
lnum = 10,
col = 2,
end_lnum = 11,