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

Investigate other sources for @mentions #1

Open
petertriho opened this issue Oct 24, 2021 · 6 comments · Fixed by #48
Open

Investigate other sources for @mentions #1

petertriho opened this issue Oct 24, 2021 · 6 comments · Fixed by #48

Comments

@petertriho
Copy link
Owner

petertriho commented Oct 24, 2021

https://github.com/suggestions?mention_suggester=1&repository=cmp-git&user_id=petertriho

Investigate if it is possible to use github's (undocumented?) suggestions api

@petertriho petertriho changed the title Investigation other sources for @mentions Investigate other sources for @mentions Oct 25, 2021
@natdm
Copy link

natdm commented May 18, 2022

Another good one would be users under the current org, achievable with https://api.github.com/orgs/<org>/members?per_page=100

@daliusd
Copy link
Contributor

daliusd commented Feb 9, 2023

Yet another approach would be to use gh like gh api repos/{owner}/{repo}/contributors. This would allow accessing private repos.

@daliusd
Copy link
Contributor

daliusd commented Feb 9, 2023

OK. I see my PR does not fix the problem but I still think that it is better than current solution. Somehow mentionableUsers does not even return contributors of repo to me (when I am in big org).

@petertriho
Copy link
Owner Author

Still need to add suggestion above (members)

@Shinzu
Copy link

Shinzu commented Feb 10, 2023

using api does not work very well with ghe hosts, you need to set GH_HOST env variable

gh repo view allows you to use also a full url for ghe hosts like

gh repo view https://<ghe host>/org/repo --json mentionableUsers which also work for github.com

edit.

gh api also allows to set --hostname which would solve this for ghe hosts

@Shinzu
Copy link

Shinzu commented Feb 10, 2023

im curious why this does not to be changed:

https://github.com/petertriho/cmp-git/blob/main/lua/cmp_git/sources/github.lua#L267

the output from api is a bit different then from repo view

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 a pull request may close this issue.

4 participants