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 GDExtension 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.
Creates a new branch named [code]branch_name[/code] in the VCS.
</description>
</method>
<methodname="_create_remote"qualifiers="virtual">
<returntype="void"/>
<paramindex="0"name="remote_name"type="String"/>
<paramindex="1"name="remote_url"type="String"/>
<description>
Creates a new remote destination with name [code]remote_name[/code] and points it to [code]remote_url[/code]. This can be an HTTPS remote or an SSH remote.
Returns an array of [Dictionary] items (see [method create_diff_file], [method create_diff_hunk], [method create_diff_line], [method add_line_diffs_into_diff_hunk] and [method add_diff_hunks_into_diff_file]), each containing information about a diff. If [code]identifier[/code] is a file path, returns a file diff, and if it is a commit identifier, then returns a commit diff.
Returns an [Array] of [Dictionary] items (see [method create_diff_hunk]), each containing a line diff between a file at [code]file_path[/code] and the [code]text[/code] which is passed in.
Returns an [Array] of [Dictionary] items (see [method create_status_file]), each containing the status data of every modified file in the project folder.
Initializes the VCS plugin when called from the editor. Returns whether or not the plugin was successfully initialized. A VCS project is initialized at [code]project_path[/code].
Pushes changes to the [param remote]. If [param force] is [code]true[/code], a force push will override the change history already present on the remote.
Set user credentials in the underlying VCS. [code]username[/code] and [code]password[/code] are used only during HTTPS authentication unless not already mentioned in the remote URL. [code]ssh_public_key_path[/code], [code]ssh_private_key_path[/code], and [code]ssh_passphrase[/code] are only used during SSH authentication.
Helper function to add an array of [code]line_diffs[/code] into a [code]diff_hunk[/code].
</description>
</method>
<methodname="create_commit">
<returntype="Dictionary"/>
<paramindex="0"name="msg"type="String"/>
<paramindex="1"name="author"type="String"/>
<paramindex="2"name="id"type="String"/>
<paramindex="3"name="unix_timestamp"type="int"/>
<paramindex="4"name="offset_minutes"type="int"/>
<description>
Helper function to create a commit [Dictionary] item. [code]msg[/code] is the commit message of the commit. [code]author[/code] is a single human-readable string containing all the author's details, e.g. the email and name configured in the VCS. [code]id[/code] is the identifier of the commit, in whichever format your VCS may provide an identifier to commits. [code]unix_timestamp[/code] is the UTC Unix timestamp of when the commit was created. [code]offset_minutes[/code] is the timezone offset in minutes, recorded from the system timezone where the commit was created.
</description>
</method>
<methodname="create_diff_file">
<returntype="Dictionary"/>
<paramindex="0"name="new_file"type="String"/>
<paramindex="1"name="old_file"type="String"/>
<description>
Helper function to create a [code]Dictionary[/code] for storing old and new diff file paths.
</description>
</method>
<methodname="create_diff_hunk">
<returntype="Dictionary"/>
<paramindex="0"name="old_start"type="int"/>
<paramindex="1"name="new_start"type="int"/>
<paramindex="2"name="old_lines"type="int"/>
<paramindex="3"name="new_lines"type="int"/>
<description>
Helper function to create a [code]Dictionary[/code] for storing diff hunk data. [code]old_start[/code] is the starting line number in old file. [code]new_start[/code] is the starting line number in new file. [code]old_lines[/code] is the number of lines in the old file. [code]new_lines[/code] is the number of lines in the new file.
</description>
</method>
<methodname="create_diff_line">
<returntype="Dictionary"/>
<paramindex="0"name="new_line_no"type="int"/>
<paramindex="1"name="old_line_no"type="int"/>
<paramindex="2"name="content"type="String"/>
<paramindex="3"name="status"type="String"/>
<description>
Helper function to create a [code]Dictionary[/code] for storing a line diff. [code]new_line_no[/code] is the line number in the new file (can be [code]-1[/code] if the line is deleted). [code]old_line_no[/code] is the line number in the old file (can be [code]-1[/code] if the line is added). [code]content[/code] is the diff text. [code]status[/code] is a single character string which stores the line origin.