EditorVcsInterface
Version Control System (VCS) interface, which reads and writes to the local VCS in use.
Version Control System (VCS) interface, which reads and writes to the local VCS in use.
Defines the API that the editor uses to extract information from the underlying VCS. The implementation of this API is included in VCS plugins, which are ReckfellExtension plugins that inherit EditorVcsInterface and are attached (on demand) to the singleton instance of EditorVcsInterface. Instead of performing the task themselves, all the virtual functions listed below are calling the internally overridden functions in the VCS plugins to provide a plug-n-play experience. A custom VCS plugin is supposed to inherit from EditorVcsInterface and override each of these virtual functions.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
EditorVcsInterfaceConstructor
public EditorVcsInterface();Methods32
AddDiffHunksIntoDiffFileReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary AddDiffHunksIntoDiffFile(Reckfell.Collections.Dictionary diffFile, Reckfell.Collections.Array<Reckfell.Collections.Dictionary> diffHunks);Helper function to add an array of diff_hunks into a diff_file.
| Name | Type | Default |
|---|---|---|
diffFile | Reckfell.Collections.Dictionary | — |
diffHunks | Reckfell.Collections.Array<Reckfell.Collections.Dictionary> | — |
Reckfell.Collections.DictionaryAddLineDiffsIntoDiffHunkReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary AddLineDiffsIntoDiffHunk(Reckfell.Collections.Dictionary diffHunk, Reckfell.Collections.Array<Reckfell.Collections.Dictionary> lineDiffs);Helper function to add an array of line_diffs into a diff_hunk.
| Name | Type | Default |
|---|---|---|
diffHunk | Reckfell.Collections.Dictionary | — |
lineDiffs | Reckfell.Collections.Array<Reckfell.Collections.Dictionary> | — |
Reckfell.Collections.DictionaryCreateCommitReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary CreateCommit(string msg, string author, string id, long unixTimestamp, long offsetMinutes);Helper function to create a commit Reckfell.Collections.Dictionary item. msg is the commit message of the commit. author is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. id is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. unix_timestamp is the UTC Unix timestamp of when the commit was created. offset_minutes is the timezone offset in minutes, recorded from the system timezone where the commit was created.
| Name | Type | Default |
|---|---|---|
msg | string | — |
author | string | — |
id | string | — |
unixTimestamp | long | — |
offsetMinutes | long | — |
Reckfell.Collections.DictionaryCreateDiffFileReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary CreateDiffFile(string newFile, string oldFile);Helper function to create a Reckfell.Collections.Dictionary for storing old and new diff file paths.
| Name | Type | Default |
|---|---|---|
newFile | string | — |
oldFile | string | — |
Reckfell.Collections.DictionaryCreateDiffHunkReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary CreateDiffHunk(int oldStart, int newStart, int oldLines, int newLines);Helper function to create a Reckfell.Collections.Dictionary for storing diff hunk data. old_start is the starting line number in old file. new_start is the starting line number in new file. old_lines is the number of lines in the old file. new_lines is the number of lines in the new file.
| Name | Type | Default |
|---|---|---|
oldStart | int | — |
newStart | int | — |
oldLines | int | — |
newLines | int | — |
Reckfell.Collections.DictionaryCreateDiffLineReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary CreateDiffLine(int newLineNo, int oldLineNo, string content, string status);Helper function to create a Reckfell.Collections.Dictionary for storing a line diff. new_line_no is the line number in the new file (can be -1 if the line is deleted). old_line_no is the line number in the old file (can be -1 if the line is added). content is the diff text. status is a single character string which stores the line origin.
| Name | Type | Default |
|---|---|---|
newLineNo | int | — |
oldLineNo | int | — |
content | string | — |
status | string | — |
Reckfell.Collections.DictionaryCreateStatusFileReckfell.Collections.Dictionary
public Reckfell.Collections.Dictionary CreateStatusFile(string filePath, EditorVcsInterface.ChangeType changeType, EditorVcsInterface.TreeArea area);Helper function to create a Reckfell.Collections.Dictionary used by editor to read the status of a file.
| Name | Type | Default |
|---|---|---|
filePath | string | — |
changeType | EditorVcsInterface.ChangeType | — |
area | EditorVcsInterface.TreeArea | — |
Reckfell.Collections.DictionaryPopupErrorvoid
public void PopupError(string msg);Pops up an error message in the editor which is shown as coming from the underlying VCS. Use this to show VCS specific error messages.
| Name | Type | Default |
|---|---|---|
msg | string | — |
_AllowAmendsbool
public virtual bool _AllowAmends();Returns whether or not the plugin allows commit amends.
bool_CheckoutBranchbool
public virtual bool _CheckoutBranch(string branchName);Checks out a branch_name in the VCS.
| Name | Type | Default |
|---|---|---|
branchName | string | — |
bool_Commitvoid
public virtual void _Commit(string msg, bool amend);Commits the currently staged changes and applies the commit msg to the resulting commit. If amend is true the commit will modify the most recent commit instead.
| Name | Type | Default |
|---|---|---|
msg | string | — |
amend | bool | — |
_CreateBranchvoid
public virtual void _CreateBranch(string branchName);Creates a new branch named branch_name in the VCS.
| Name | Type | Default |
|---|---|---|
branchName | string | — |
_CreateRemotevoid
public virtual void _CreateRemote(string remoteName, string remoteUrl);Creates a new remote destination with name remote_name and points it to remote_url. This can be an HTTPS remote or an SSH remote.
| Name | Type | Default |
|---|---|---|
remoteName | string | — |
remoteUrl | string | — |
_DiscardFilevoid
public virtual void _DiscardFile(string filePath);Discards the changes made in a file present at file_path.
| Name | Type | Default |
|---|---|---|
filePath | string | — |
_Fetchvoid
public virtual void _Fetch(string remote);Fetches new changes from the remote, but doesn't write changes to the current working directory. Equivalent to git fetch.
| Name | Type | Default |
|---|---|---|
remote | string | — |
_GetBranchListReckfell.Collections.Array<string>
public virtual Reckfell.Collections.Array<string> _GetBranchList();Gets an instance of an Reckfell.Collections.Array of strings containing available branch names in the VCS.
Reckfell.Collections.Array<string>_GetCurrentBranchNamestring
public virtual string _GetCurrentBranchName();Gets the current branch name defined in the VCS.
string_GetDiffReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public virtual Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetDiff(string identifier, int area);Returns an array of Reckfell.Collections.Dictionary items (see EditorVcsInterface.CreateDiffFile, EditorVcsInterface.CreateDiffHunk, EditorVcsInterface.CreateDiffLine, EditorVcsInterface.AddLineDiffsIntoDiffHunk and EditorVcsInterface.AddDiffHunksIntoDiffFile), each containing information about a diff. If identifier is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff.
| Name | Type | Default |
|---|---|---|
identifier | string | — |
area | int | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>_GetLineDiffReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public virtual Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetLineDiff(string filePath, string text);Returns an Reckfell.Collections.Array of Reckfell.Collections.Dictionary items (see EditorVcsInterface.CreateDiffHunk), each containing a line diff between a file at file_path and the text which is passed in.
| Name | Type | Default |
|---|---|---|
filePath | string | — |
text | string | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>_GetModifiedFilesDataReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public virtual Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetModifiedFilesData();Returns an Reckfell.Collections.Array of Reckfell.Collections.Dictionary items (see EditorVcsInterface.CreateStatusFile), each containing the status data of every modified file in the project folder.
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>_GetPreviousCommitsReckfell.Collections.Array<Reckfell.Collections.Dictionary>
public virtual Reckfell.Collections.Array<Reckfell.Collections.Dictionary> _GetPreviousCommits(int maxCommits);Returns an Reckfell.Collections.Array of Reckfell.Collections.Dictionary items (see EditorVcsInterface.CreateCommit), each containing the data for a past commit.
| Name | Type | Default |
|---|---|---|
maxCommits | int | — |
Reckfell.Collections.Array<Reckfell.Collections.Dictionary>_GetRemotesReckfell.Collections.Array<string>
public virtual Reckfell.Collections.Array<string> _GetRemotes();Returns an Reckfell.Collections.Array of strings, each containing the name of a remote configured in the VCS.
Reckfell.Collections.Array<string>_GetVcsNamestring
public virtual string _GetVcsName();Returns the name of the underlying VCS provider.
string_Initializebool
public virtual bool _Initialize(string projectPath);Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at project_path.
| Name | Type | Default |
|---|---|---|
projectPath | string | — |
bool_Pullvoid
public virtual void _Pull(string remote);Pulls changes from the remote. This can give rise to merge conflicts.
| Name | Type | Default |
|---|---|---|
remote | string | — |
_Pushvoid
public virtual void _Push(string remote, bool force);Pushes changes to the remote. If force is true, a force push will override the change history already present on the remote.
| Name | Type | Default |
|---|---|---|
remote | string | — |
force | bool | — |
_RemoveBranchvoid
public virtual void _RemoveBranch(string branchName);Remove a branch from the local VCS.
| Name | Type | Default |
|---|---|---|
branchName | string | — |
_RemoveRemotevoid
public virtual void _RemoveRemote(string remoteName);Remove a remote from the local VCS.
| Name | Type | Default |
|---|---|---|
remoteName | string | — |
_SetCredentialsvoid
public virtual void _SetCredentials(string userName, string password, string sshPublicKeyPath, string sshPrivateKeyPath, string sshPassphrase);Set user credentials in the underlying VCS. username and password are used only during HTTPS authentication unless not already mentioned in the remote URL. ssh_public_key_path, ssh_private_key_path, and ssh_passphrase are only used during SSH authentication.
| Name | Type | Default |
|---|---|---|
userName | string | — |
password | string | — |
sshPublicKeyPath | string | — |
sshPrivateKeyPath | string | — |
sshPassphrase | string | — |
_ShutDownbool
public virtual bool _ShutDown();Shuts down VCS plugin instance. Called when the user either closes the editor or shuts down the VCS plugin through the editor UI.
bool_StageFilevoid
public virtual void _StageFile(string filePath);Stages the file present at file_path to the staged area.
| Name | Type | Default |
|---|---|---|
filePath | string | — |
_UnstageFilevoid
public virtual void _UnstageFile(string filePath);Unstages the file present at file_path from the staged area to the unstaged area.
| Name | Type | Default |
|---|---|---|
filePath | string | — |
EditorVcsInterface.ChangeType
| Value | Description |
|---|---|
Deleted = 3 | An earlier added file has been deleted. |
Modified = 1 | An earlier added file has been modified. |
New = 0 | A new file has been added. |
Renamed = 2 | An earlier added file has been renamed. |
Typechange = 4 | An earlier added file has been typechanged. |
Unmerged = 5 | A file is left unmerged. |
EditorVcsInterface.TreeArea
| Value | Description |
|---|---|
Commit = 0 | A commit is encountered from the commit area. |
Staged = 1 | A file is encountered from the staged area. |
Unstaged = 2 | A file is encountered from the unstaged area. |