MCPcopy Create free account
hub / github.com/colbymchenry/codegraph / generate

Method generate

codegraph-kernel/src/ids.rs:26–42  ·  view source on GitHub ↗
(
        &mut self,
        file_path: &str,
        kind: &str,
        name: &str,
        line: u32,
        column: u32,
    )

Source from the content-addressed store, hash-verified

24
25impl NodeIdAllocator {
26 pub fn generate(
27 &mut self,
28 file_path: &str,
29 kind: &str,
30 name: &str,
31 line: u32,
32 column: u32,
33 ) -> String {
34 let id = node_id(file_path, kind, name, line);
35 // Zero-based UTF-16 column (util::col16), never tree-sitter's byte column.
36 let first_column = self.first_columns.entry(id.clone()).or_insert(column);
37 if *first_column == column {
38 id
39 } else {
40 format!("{id}:{column}")
41 }
42 }
43}
44
45pub fn node_id(file_path: &str, kind: &str, name: &str, line: u32) -> String {

Callers 15

create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45
create_nodeMethod · 0.45

Calls 1

node_idFunction · 0.85

Tested by

no test coverage detected