use super::Language;
use tree_sitter::Node;
pub struct Markdown;
impl Language for Markdown {
fn name(&self) -> &'static str {
"markdown"
}
fn get_ts_language(&self) -> tree_sitter::Language {
tree_sitter_json::LANGUAGE.into()
}
fn get_meaningful_kinds(&self) -> Vec<&'static str> {
vec![]
}
fn extract_symbols(&self, _node: Node, contents: &str) -> Vec<String> {
let mut symbols = Vec::new();
for line in contents.lines() {
let trimmed = line.trim();
if trimmed.starts_with('#') && !trimmed.starts_with("```") {
let heading_text = trimmed.trim_start_matches('#').trim();
if !heading_text.is_empty() {
symbols.push(heading_text.to_string());
}
}
}
symbols
}
fn extract_identifiers(&self, _node: Node, _contents: &str, _symbols: &mut Vec<String>) {
}
fn get_node_type_description(&self, _node_type: &str) -> &'static str {
"markdown headings"
}
#[allow(dead_code)]
fn extract_imports_exports(&self, _node: Node, _contents: &str) -> (Vec<String>, Vec<String>) {
(Vec::new(), Vec::new())
}
fn resolve_import(
&self,
_import_path: &str,
_source_file: &str,
_all_files: &[String],
) -> Option<String> {
None
}
fn get_file_extensions(&self) -> Vec<&'static str> {
vec!["md", "markdown"]
}
}
impl Markdown {}