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

Method is_const

codegraph-kernel/src/csharp.rs:470–486  ·  view source on GitHub ↗

isConst: `const` → true; else `static` AND `readonly` both present.

(&self, node: Node)

Source from the content-addressed store, hash-verified

468
469 /// isConst: `const` → true; else `static` AND `readonly` both present.
470 fn is_const(&self, node: Node) -> bool {
471 let mut has_static = false;
472 let mut has_readonly = false;
473 for i in 0..node.child_count() {
474 let Some(child) = node.child(i) else { continue };
475 if child.kind() != "modifier" {
476 continue;
477 }
478 match self.text(child) {
479 "const" => return true,
480 "static" => has_static = true,
481 "readonly" => has_readonly = true,
482 _ => {}
483 }
484 }
485 has_static && has_readonly
486 }
487
488 /// extractCsharpReturnType — reads the `returns` field; feeds the
489 /// #645/#608 chained-call resolution. Constructors have no `returns`.

Callers 2

extract_fieldMethod · 0.45
extract_variableMethod · 0.45

Calls 1

textMethod · 0.65

Tested by

no test coverage detected