Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FEAT]: allow to search text_matches with fragment length #2572

Closed
1 task done
md-robiul-hassan-kr opened this issue Nov 13, 2023 · 2 comments
Closed
1 task done

[FEAT]: allow to search text_matches with fragment length #2572

md-robiul-hassan-kr opened this issue Nov 13, 2023 · 2 comments
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs

Comments

@md-robiul-hassan-kr
Copy link

md-robiul-hassan-kr commented Nov 13, 2023

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
@md-robiul-hassan-kr md-robiul-hassan-kr added Status: Triage This is being looked at and prioritized Type: Feature New feature or request labels Nov 13, 2023
Copy link

👋 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! 🚀

@gr2m
Copy link
Contributor

gr2m commented Nov 13, 2023

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

@gr2m gr2m closed this as completed Nov 13, 2023
@github-project-automation github-project-automation bot moved this from 🆕 Triage to ✅ Done in 🧰 Octokit Active Nov 13, 2023
@gr2m gr2m added Type: Support Any questions, information, or general needs around the SDK or GitHub APIs and removed Type: Feature New feature or request Status: Triage This is being looked at and prioritized labels Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Support Any questions, information, or general needs around the SDK or GitHub APIs
Projects
Archived in project
Development

No branches or pull requests

2 participants