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

Method is_const

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

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

(&self, node: Node)

Source from the content-addressed store, hash-verified

446
447 /// isConst: `const` → true; else `static` AND `readonly` both present.
448 fn is_const(&self, node: Node) -> bool {
449 let mut has_static = false;
450 let mut has_readonly = false;
451 for i in 0..node.child_count() {
452 let Some(child) = node.child(i) else { continue };
453 if child.kind() != "modifier" {
454 continue;
455 }
456 match self.text(child) {
457 "const" => return true,
458 "static" => has_static = true,
459 "readonly" => has_readonly = true,
460 _ => {}
461 }
462 }
463 has_static && has_readonly
464 }
465
466 /// extractCsharpReturnType — reads the `returns` field; feeds the
467 /// #645/#608 chained-call resolution. Constructors have no `returns`.

Callers 2

extract_fieldMethod · 0.45
extract_variableMethod · 0.45

Calls 1

textMethod · 0.45

Tested by

no test coverage detected