tigerxy / VSCode-ShareCode

Share Code is an Extension for Visual Studio Code. You can find it on marketplace.
https://marketplace.visualstudio.com/items?itemName=RolandGreim.sharecode
GNU General Public License v3.0
35 stars 13 forks source link

GitLab support #13

Open CBainx opened 7 years ago

CBainx commented 7 years ago

I was not able to get GitLab support working on the latest 9.1 release. First, in the project snippets api 'visibility_level' was changed to 'visibility' and was changed from numbers (0, 10, 20) to strings (private, internal, public). Also there is no indication as to what the base URL should be for private gitlab instances. 'base.level.domain' does not work, I had to use 'base.level.domain/api/v4'. I think this should be added to the readme. Also for some reason some files are pasted to gitlab just fine after these changes, but other (usually bigger files, can't figure out which symbols exactly cause the 404) will not paste and the plugin provides no indication of a failure or success. I noticed that the API was generated by swagger, so I think it would be easier to just regenerate the API rather than me fixing the generated code and providing a pull request.

If you do need help solving this issue let me know, I'd be willing to help. I would also be interested in taking advantage of the new User Snippets API instead of (or possibly in combination with) using project snippets.

batjko commented 7 years ago

I did get it to work adding the /api/v4 to the base URL (thanks for the tip @CBainx). One thing that's missing now though, is that I am forced to select a project. However, in Gitlab I can create a snippet just under my profile, not connected to any specific project.

Sharing a snippet in this more generic way makes much more sense than having to make it part of a project.

codeborui commented 6 years ago

@CBainx What the base URL should be for? 'https://gitlab.com/api/v4'?

CBainx commented 6 years ago

@codeborui Yes, that is the URL you will want to use if you have a gitlab account and are not hosting your own server.

grahamannett commented 6 years ago

Gitlab doesnt seem to work for me at all. I'd be willing to try and fix and PR to it i guess since the rest of the plugin is pretty great.

fieldse commented 6 years ago

+1, I'm interested in this issue too. Anyone have enough knowledge to know how to diagnose what's happening? @grahamannett or @batjko Appending API url to base url 'https://gitlab.com/api/v4 presents me with a list of public projects, but not my own. Sounds like the API key authorization didn't work.

nezorflame commented 5 years ago

Still experiencing the same issue here.