Skip to content
This repository was archived by the owner on Sep 9, 2025. It is now read-only.

Commit fa11792

Browse files
author
Hendrik van Antwerpen
committed
Use root_node convenience method
1 parent 488bb23 commit fa11792

File tree

2 files changed

+2
-4
lines changed

2 files changed

+2
-4
lines changed

languages/tree-sitter-stack-graphs-typescript/rust/npm_package.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// ------------------------------------------------------------------------------------------------
77

88
use serde::Deserialize;
9-
use stack_graphs::graph::NodeID;
109
use std::collections::HashMap;
1110
use std::path::Path;
1211

@@ -42,7 +41,7 @@ impl FileAnalyzer for NpmPackageAnalyzer {
4241
serde_json::from_str(source).map_err(|_| LoadError::ParseError)?;
4342

4443
// root node
45-
let root = graph.node_for_id(NodeID::root()).unwrap();
44+
let root = StackGraph::root_node();
4645

4746
// project scope
4847
let proj_scope_id = graph.new_node_id(file);

languages/tree-sitter-stack-graphs-typescript/rust/tsconfig.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
// ------------------------------------------------------------------------------------------------
77

88
use glob::Pattern;
9-
use stack_graphs::graph::NodeID;
109
use std::collections::HashMap;
1110
use std::path::Component;
1211
use std::path::Path;
@@ -43,7 +42,7 @@ impl FileAnalyzer for TsConfigAnalyzer {
4342
let tsc = TsConfig::parse_str(path, source).map_err(|_| LoadError::ParseError)?;
4443

4544
// root node
46-
let root = graph.node_for_id(NodeID::root()).unwrap();
45+
let root = StackGraph::root_node();
4746

4847
// project scope
4948
let proj_scope_id = graph.new_node_id(file);

0 commit comments

Comments
 (0)