Skip to main content

extract_paths

Function extract_paths 

Source
pub fn extract_paths(description: &str) -> Vec<String>
Expand description

Extracts file paths from a bean description using regex pattern matching.

Matches relative file paths with the following extensions: .rs, .ts, .py, .md, .json, .toml, .yaml, .sh, .go, .java

Examples:

  • “Modify src/main.rs” → [“src/main.rs”]
  • “See src/foo.rs and tests/bar.rs” → [“src/foo.rs”, “tests/bar.rs”]
  • “File: src/main.rs.” → [“src/main.rs”]

§Arguments

  • description - The description text to search for file paths

§Returns

A Vec of deduplicated file paths in order of appearance