stakwork / stakwork/stakgraph

Graph trait for abstract nodes store

Open
#38 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
TypeScript
Stars
112
Forks
21
Avg merge
5h 55m
Merged PRs (30d)
115

Description

Graph trait with the method:

find_nodes(node_type: NodeType, name: &str) -> Vec<Node>​

This we can use in many places. For example, instead of the find_only_one_function_file(func_name: &str, graph: &Graph) function in ast/src/lang/parse.rs, we can add another method to Graph, which uses self.find_nodes internally.

Sometimes its good to avoid a generic arg, like for find_function_parent. So try a closure arg instead, something like:

fn find_function_parent(&self, _cf: &dyn Fn(&str) -> Option<NodeData>) -> Result<Option<Operand>> {
        Ok(None)
}

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with ast/src/lang/parse.rs, especially find_only_one_function_file, and trace the existing Graph, NodeType, Node, and NodeData abstractions. Determine the scope of the Graph trait and whether find_function_parent should use a closure; the work is done when the shared lookup methods and their callers use the agreed abstraction.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers
Issue type
Refactor
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.