[FEAT]: allow to search text_matches with fragment length
md-robiul-hassan-kr opened this issue · comments
Allow full code block search
(async () => {
const response = await octokit.request('GET /search/code?q={q}&type={type}', {
q: `jquery`,
type: 'Code',
headers: {
'Accept': 'application/vnd.github.text-match+json'
},
per_page: 100
}).then(res => res.data.items.map(r => r.text_matches));
console.log('----------: ', response);
})();
in the return
{
object_url: '',
object_type: 'FileContent',
property: 'content',
fragment: ' ',
matches: [Array]
}
allow to return fragment code for full block of code or allow a fixed length of code.
example if I have a <div class: 'my-header' > 3 line of code block , and I want to be able to return the full code for that block when I search "my-header".
if there is already existing support already please share.
SDK Version
"octokit": "^2.0.14",
API Version
"octokit": "^2.0.14",
Relevant log output
No response
Code of Conduct
- I agree to follow this project's Code of Conduct
👋 Hi! Thank you for this contribution! Just to let you know, our GitHub SDK team does a round of issue and PR reviews twice a week, every Monday and Friday! We have a process in place for prioritizing and responding to your input. Because you are a part of this community please feel free to comment, add to, or pick up any issues/PRs that are labled with Status: Up for grabs
. You & others like you are the reason all of this works! So thank you & happy coding! 🚀
Here is the documentation for the REST API in question:
https://docs.github.com/en/free-pro-team@latest/rest/search/search?apiVersion=2022-11-28#search-code
There is no addiontal parameter that is not exposed in Octokit. If you would like to ask for a change of an existing REST API endpoint, the best place to ask is the community form at https://github.com/orgs/community/discussions/categories/api-and-webhooks