feat: add code search tools (search_code, search_project_code, search_group_code)#358
feat: add code search tools (search_code, search_project_code, search_group_code)#358pacifical wants to merge 4 commits intozereight:mainfrom
Conversation
|
@zereight do you mind taking a look? |
|
Nice implementation! I was actually looking into implementing a similar feature myself and noticed this PR already exists, so I wanted to share a couple of thoughts that might help extend it a bit further. 1. REST vs GraphQL code search APIsGitLab currently exposes code search through two different APIs:
One small detail though: GraphQL Because of that, it might be worth making this configurable, for example via something like
2. Zoekt query syntax could be documented in the tool descriptionIf the instance has exact code search (Zoekt) enabled, the search query supports a much richer inline syntax: Docs: Exact code search syntax Examples:
Since these filters ( Not a blocker of course, just something I ran into while exploring the same area and thought might be useful context. |
|
@DarkByteZero thanks for your feedback. agreed on the tool description, added this. |
|
i mean when this gets merged i can build onto that, thanks |
Closes #280
Adds three code search tools using the GitLab Search API
blobsscope:search_code— global code search across all projects (GET /search?scope=blobs)search_project_code— search within a specific project (GET /projects/:id/search?scope=blobs)search_group_code— search within a specific group (GET /groups/:id/search?scope=blobs)All three tools support optional filters:
ref,filename,path,extension, and pagination (page,per_page).Toolset
New
searchtoolset withisDefault: false(opt-in). Requires advanced search or exact code search enabledon the GitLab instance.
Enable via: