feat: rag-embedding-ai-chat (#1)
Co-authored-by: Sharang Parnerkar <parnerkarsharang@gmail.com> Reviewed-on: #1
This commit was merged in pull request #1.
This commit is contained in:
@@ -7,6 +7,12 @@ use tree_sitter::{Node, Parser};
|
||||
|
||||
pub struct JavaScriptParser;
|
||||
|
||||
impl Default for JavaScriptParser {
|
||||
fn default() -> Self {
|
||||
Self::new()
|
||||
}
|
||||
}
|
||||
|
||||
impl JavaScriptParser {
|
||||
pub fn new() -> Self {
|
||||
Self
|
||||
@@ -51,7 +57,13 @@ impl JavaScriptParser {
|
||||
|
||||
if let Some(body) = node.child_by_field_name("body") {
|
||||
self.extract_calls(
|
||||
body, source, file_path, repo_id, graph_build_id, &qualified, output,
|
||||
body,
|
||||
source,
|
||||
file_path,
|
||||
repo_id,
|
||||
graph_build_id,
|
||||
&qualified,
|
||||
output,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -97,7 +109,12 @@ impl JavaScriptParser {
|
||||
|
||||
if let Some(body) = node.child_by_field_name("body") {
|
||||
self.walk_children(
|
||||
body, source, file_path, repo_id, graph_build_id, Some(&qualified),
|
||||
body,
|
||||
source,
|
||||
file_path,
|
||||
repo_id,
|
||||
graph_build_id,
|
||||
Some(&qualified),
|
||||
output,
|
||||
);
|
||||
}
|
||||
@@ -130,7 +147,13 @@ impl JavaScriptParser {
|
||||
|
||||
if let Some(body) = node.child_by_field_name("body") {
|
||||
self.extract_calls(
|
||||
body, source, file_path, repo_id, graph_build_id, &qualified, output,
|
||||
body,
|
||||
source,
|
||||
file_path,
|
||||
repo_id,
|
||||
graph_build_id,
|
||||
&qualified,
|
||||
output,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -138,7 +161,13 @@ impl JavaScriptParser {
|
||||
// Arrow functions assigned to variables: const foo = () => {}
|
||||
"lexical_declaration" | "variable_declaration" => {
|
||||
self.extract_arrow_functions(
|
||||
node, source, file_path, repo_id, graph_build_id, parent_qualified, output,
|
||||
node,
|
||||
source,
|
||||
file_path,
|
||||
repo_id,
|
||||
graph_build_id,
|
||||
parent_qualified,
|
||||
output,
|
||||
);
|
||||
}
|
||||
"import_statement" => {
|
||||
@@ -183,7 +212,13 @@ impl JavaScriptParser {
|
||||
let mut cursor = node.walk();
|
||||
for child in node.children(&mut cursor) {
|
||||
self.walk_tree(
|
||||
child, source, file_path, repo_id, graph_build_id, parent_qualified, output,
|
||||
child,
|
||||
source,
|
||||
file_path,
|
||||
repo_id,
|
||||
graph_build_id,
|
||||
parent_qualified,
|
||||
output,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -217,7 +252,13 @@ impl JavaScriptParser {
|
||||
let mut cursor = node.walk();
|
||||
for child in node.children(&mut cursor) {
|
||||
self.extract_calls(
|
||||
child, source, file_path, repo_id, graph_build_id, caller_qualified, output,
|
||||
child,
|
||||
source,
|
||||
file_path,
|
||||
repo_id,
|
||||
graph_build_id,
|
||||
caller_qualified,
|
||||
output,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -263,7 +304,12 @@ impl JavaScriptParser {
|
||||
|
||||
if let Some(body) = value_n.child_by_field_name("body") {
|
||||
self.extract_calls(
|
||||
body, source, file_path, repo_id, graph_build_id, &qualified,
|
||||
body,
|
||||
source,
|
||||
file_path,
|
||||
repo_id,
|
||||
graph_build_id,
|
||||
&qualified,
|
||||
output,
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user