Skip to content

Conversation

@grl-wang
Copy link
Contributor

Problem

adding the grep search and file search tool for testing

Solution

1. Implemented the grep search tool using https://github.com/microsoft/vscode-ripgrep.
2. The grepped result show as clickable file path.
3. Implemented the file search tool.
3. The tool currently is disable in current pr, once grepSearch tool tested, will update the tool_index.json to enable this tool.

  • Treat all work as PUBLIC. Private feature/x branches will not be squash-merged at release time.
  • Your code changes must meet the guidelines in CONTRIBUTING.md.
  • License: I confirm that my contribution is made under the terms of the Apache 2.0 license.

    1. Implemented the grep search tool using https://github.com/microsoft/vscode-ripgrep.
    2. The grepped result show as clickable file path.
    3. Implemented the file search tool.
    3. The tool currently is disable in current pr, once grepSearch tool tested,
       will update the tool_index.json to enable this tool.
@github-actions
Copy link

  • This pull request implements a feat or fix, so it must include a changelog entry (unless the fix is for an unreleased feature). Review the changelog guidelines.
    • Note: beta or "experiment" features that have active users should announce fixes in the changelog.
    • If this is not a feature or fix, use an appropriate type from the title guidelines. For example, telemetry-only changes should use the telemetry type.

@grl-wang grl-wang marked this pull request as ready for review April 17, 2025 17:31
@grl-wang grl-wang requested review from a team as code owners April 17, 2025 17:31
NODE_OPTIONS: '--max-old-space-size=8192'
AWS_TOOLKIT_TEST_CACHE_DIR: '/tmp/.vscode-test/'
AWS_TOOLKIT_TEST_USER_DIR: '/tmp/.vscode-test/user-data/'
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are setting this up to increase GitHub API Limit while download the ripgrep binary.
ref: https://github.com/microsoft/vscode-ripgrep

You can produce an API key, set the GITHUB_TOKEN environment var to it, and vscode-ripgrep will use it when downloading from GitHub. This increases your API limit.
  1. Without this the most CI test will fail during download ripegrep binary.

"vscode-nls": "^5.2.0",
"vscode-nls-dev": "^4.0.4"
"vscode-nls-dev": "^4.0.4",
"@vscode/ripgrep": "1.15.11"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this the right place to add it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, based on the vscode ripgrep, it asked to add in the dependencies, not dev dependencies: https://github.com/microsoft/vscode-ripgrep.

private createOutput(content: string): InvokeOutput {
return {
output: {
kind: OutputKind.Text,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use JSON format seems like a better fit for this tool

public async invoke(updates?: Writable): Promise<InvokeOutput> {
try {
const fileUri = vscode.Uri.file(this.fsPath)
const allFiles = await readDirectoryRecursively(fileUri, this.maxDepth)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filter to only keep [F] prefix?

- export HOME=/home/codebuild-user
# Set up VSCODE_RIPGREP_TOKEN for GitHub API access
- export VSCODE_RIPGREP_TOKEN=${GITHUB_READONLY_TOKEN}
- echo "Setting up VSCODE_RIPGREP_TOKEN for GitHub API access"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

similar as the GITHUB TOKEN env, set it setting this up to increase GitHub API Limit while download the ripgrep binary. otherwise, the ripgrep download failed.

@grl-wang grl-wang closed this by deleting the head repository May 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants