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

Method is_const

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

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

(&self, node: Node)

Source from the content-addressed store, hash-verified

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

Callers 2

extract_fieldMethod · 0.45
extract_variableMethod · 0.45

Calls 3

childrenMethod · 0.80
textMethod · 0.65
walkMethod · 0.45

Tested by

no test coverage detected