MCPcopy Create free account
hub / github.com/aws/amazon-q-developer-cli / get_context_files

Method get_context_files

crates/chat-cli/src/cli/chat/context.rs:197–206  ·  view source on GitHub ↗

Get all context files (global + profile-specific). This method: 1. Processes all paths in the global and profile configurations 2. Expands glob patterns to include matching files 3. Reads the content of each file 4. Returns a vector of (filename, content) pairs # Returns A Result containing a vector of (filename, content) pairs or an error

(&self, os: &Os)

Source from the content-addressed store, hash-verified

195 /// # Returns
196 /// A Result containing a vector of (filename, content) pairs or an error
197 pub async fn get_context_files(&self, os: &Os) -> Result<Vec<(String, String)>> {
198 let mut context_files = Vec::new();
199
200 self.collect_context_files(os, &self.paths, &mut context_files).await?;
201
202 context_files.sort_by(|a, b| a.0.cmp(&b.0));
203 context_files.dedup_by(|a, b| a.0 == b.0);
204
205 Ok(context_files)
206 }
207
208 pub async fn get_context_files_by_path(&self, os: &Os, path: &str) -> Result<Vec<(String, String)>> {
209 let mut context_files = Vec::new();

Callers 3

test_path_opsFunction · 0.80
get_contextMethod · 0.80

Calls 1

collect_context_filesMethod · 0.80

Tested by 1

test_path_opsFunction · 0.64