Moar improvements - #1
Merged
Merged
Conversation
- Add join_error() helper in error.rs to replace the identical 5-line .map_err(|e| rmcp::ErrorData::internal_error(...)) closure repeated in all four tool handlers. - Add ToolResult<T> type alias for Result<T, rmcp::ErrorData>. - Update all tool methods in server.rs to use join_error and ToolResult. - Mark improvement plan item #4 as completed.
…vement #15) - Add OutputMode enum (FilesWithMatches, Content, Count) to tools.rs with from_str_lossy() that rejects unknown values as invalid_params. - Add output_mode field to GrepArgs (default: files_with_matches) and GrepOptions. - Implement grep_files(): emits file path on first match, aborts per-file early (faster than reading the whole file). max_results caps files. - Implement grep_count(): per-file match tallies as 'path: N' lines, sorted by path. - grep_content(): unchanged original behaviour. - Extract build_parallel_walker(), extension_matches(), error_metadata() helpers to reduce duplication across the three modes. - Add FileMatchSink and CountSink types for the new modes. - Update server instructions and tool description to document modes. - Add 4 new tests; update existing tests to set output_mode explicitly. - Mark improvement plan item #15 as completed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
with
cargo-distthis time