Draft: feat(view issues-and-mrs): checkout branch by merge request #63
Summary
Implementation issues #63 (closed).
Recently drew attention to your extension. In the current version I am sorely missing the feature outlined in issue 63. I decided to add it. Found you have an outdated merge. Unfortunately, it is no longer too relevant. Therefore, I wrote my
I tried to change only the most necessary for this task, but unfortunately the problems with the types did not allow us to do the very minimum. More below.
How it work
What had to be redone
- For data providers, when initializing tree items, I wrote the name of their class into the context value (see
src/data_providers/current_branch.ts
andsrc/data_providers/issuable.ts
). This allows you to write conditions for view items in the manifest.
...
"view/item/context": [
{
"command": "gl.commandName",
"when": "view =~ /viewInternalId/ && viewItem == ItemClassName",
"group": "someGroup"
}
],
...
- I had to introduce more precise types for the objects that we get from the gitlab api (see folder
src/models/gitlab
). I removed duplicate types from the filetypes.d.ts
and replaced them in the code. (PS: I defined the types by interfaces, according to your style, although I myself do not like this.) - The command to fetch a branch is in
src/commands/mr_branch_commands.ts
. I reinitialized the git extension because I did not understand how to refer to the instance that is initialized when the application is activated.
Env. details
- my typescript version: 4.2.3
Edited by Musisimaru