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

Method is_const

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

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

(&self, node: Node)

Source from the content-addressed store, hash-verified

459
460 /// isConst: `const` → true; else `static` AND `readonly` both present.
461 fn is_const(&self, node: Node) -> bool {
462 let mut has_static = false;
463 let mut has_readonly = false;
464 for i in 0..node.child_count() {
465 let Some(child) = node.child(i) else { continue };
466 if child.kind() != "modifier" {
467 continue;
468 }
469 match self.text(child) {
470 "const" => return true,
471 "static" => has_static = true,
472 "readonly" => has_readonly = true,
473 _ => {}
474 }
475 }
476 has_static && has_readonly
477 }
478
479 /// extractCsharpReturnType — reads the `returns` field; feeds the
480 /// #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