lean-ctx 3.6.5

Context Runtime for AI Agents with CCP. 51 MCP tools, 10 read modes, 60+ compression patterns, cross-session memory (CCP), persistent AI knowledge with temporal facts + contradiction detection, multi-agent context sharing, LITM-aware positioning, AAAK compact format, adaptive compression with Thompson Sampling bandits. Supports 24+ AI tools. Reduces LLM token consumption by up to 99%.
Documentation
use tree_sitter::Node;

use crate::core::signatures::Signature;

pub(crate) fn elixir_call(node: &Node, name: &str, source: &[u8]) -> Option<Signature> {
    let target = node
        .child_by_field_name("target")
        .and_then(|n| n.utf8_text(source).ok())
        .unwrap_or("");
    match target {
        "defmodule" | "defprotocol" => Some(Signature {
            kind: "class",
            name: name.to_string(),
            params: String::new(),
            return_type: String::new(),
            is_async: false,
            is_exported: true,
            indent: 0,
            ..Signature::no_span()
        }),
        "def" | "defmacro" | "defdelegate" | "defguard" => Some(Signature {
            kind: "fn",
            name: name.to_string(),
            params: String::new(),
            return_type: String::new(),
            is_async: false,
            is_exported: true,
            indent: 2,
            ..Signature::no_span()
        }),
        "defp" | "defmacrop" | "defguardp" => Some(Signature {
            kind: "fn",
            name: name.to_string(),
            params: String::new(),
            return_type: String::new(),
            is_async: false,
            is_exported: false,
            indent: 2,
            ..Signature::no_span()
        }),
        _ => None,
    }
}