cmp-git icon indicating copy to clipboard operation
cmp-git copied to clipboard

Investigate other sources for @mentions

Open petertriho opened this issue 4 years ago • 6 comments

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 avatar Oct 24 '21 06:10 petertriho

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

natdm avatar May 18 '22 12:05 natdm

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

daliusd avatar Feb 09 '23 11:02 daliusd

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).

daliusd avatar Feb 09 '23 12:02 daliusd

Still need to add suggestion above (members)

petertriho avatar Feb 10 '23 04:02 petertriho

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 avatar Feb 10 '23 11:02 Shinzu

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

Shinzu avatar Feb 10 '23 14:02 Shinzu