Method and system for integrating Git platform function in code editor

By integrating Git platform functions in the code editor, using plug-in loading and API calls, the separation of code development and project management is solved, and efficient and continuous operation processes and optimized user experience is achieved.

CN119938012APending Publication Date: 2025-05-06HUNAN INST OF ADVANCED TECH
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510132136.6
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-06
Publication Date
2025-05-06

AI Technical Summary

Technical Problem

In the prior art, code development and project management require frequent switching of code editors and Git platforms, resulting in interruption of work continuity, cumbersome operation steps, and affecting work efficiency.

Method used

Integrate Git platform functions in the code editor, obtain project files by loading plug-ins, parse Git configuration files, automatically identify platform types and call corresponding API services, and realize one-stop operations.

Benefits of technology

It realizes seamless use of Git platform functions in the code editor, simplifies operational processes, improves work efficiency, and maintains user data status when platform switching, optimizing user experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119938012A_ABST
    Figure CN119938012A_ABST
Patent Text Reader

Abstract

The invention relates to a method and system for integrating a Git platform function in a code editor, and the method comprises the steps: receiving a plug-in loading instruction, completing the loading of a current plug-in according to the plug-in loading instruction, obtaining a project file opened in the current code editor through the current plug-in, carrying out the configuration analysis of the project file, obtaining a git configuration file, and storing the git configuration file in the code editor. The platform type of the Git platform is obtained according to the git configuration file, API services matched with the platform type are called through a unified API calling interface, and the function of integrating the Git platform in the current code editor is achieved. Therefore, a user can use the function of the Git platform in the code editor, multiple times of switching between the code editor and the Git platform is not needed, the operation is simplified and the working efficiency is improved while the working continuity is ensured, the API service is called through a uniform API calling interface, and the user experience is improved. It is ensured that the user data state can be kept during subsequent Git platform switching, and the user experience is optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of computer technology, and in particular to a method and system for integrating Git platform functions into a code editor. Background Art

[0002] The current common approach to code development and project management is to use a code editor for code development and a Git platform that provides Git services for project management. This requires users to switch between the code editor and the Git platform multiple times when managing projects, disrupting work continuity and creating a disconnect between project management and code development. Furthermore, the user experience is cumbersome, adding unnecessary time and impacting work efficiency. Summary of the Invention

[0003] The technical problem to be solved by the present invention is: the present invention provides a method and system for integrating Git platform functions into a code editor, which ensures work continuity while simplifying operations and improving work efficiency.

[0004] In order to solve the above technical problems, the technical solution adopted by the present invention is:

[0005] In a first aspect, the present invention provides a method for integrating Git platform functions in a code editor, comprising:

[0006] Receive a plug-in loading instruction, complete the loading of the current plug-in according to the plug-in loading instruction, obtain the project file opened in the current code editor through the current plug-in, perform configuration analysis on the project file, and obtain a git configuration file;

[0007] The platform type of the Git platform is obtained according to the git configuration file, and the API service matching the platform type is called through a unified API calling interface to realize the function of integrating the Git platform into the current code editor.

[0008] The beneficial effect of the present invention is that: the project file opened in the current code editor is obtained by the loaded current plug-in, and the configuration of the project file is parsed to obtain the git configuration file, thereby automatically identifying the platform type of the Git platform, and dynamically matching and calling the API service corresponding to the platform type to realize the function of integrating the Git platform in the current code editor, that is, the user can use the function of the Git platform in the current code editor without switching between the code editor and the Git platform multiple times, completing the whole process operation in one stop, ensuring work continuity while simplifying operations and improving work efficiency, and when calling the API service, it is called through a unified API calling interface, ensuring that the user data status can be maintained when switching the Git platform later, and optimizing the user experience.

[0009] Optionally, the functions of the Git platform include user management function, issues management function, code merge management function, warehouse information management function and milestone management function.

[0010] According to the above description, splitting the functions of the Git platform into multiple separate functions can achieve a high cohesion and low coupling design and improve flexibility.

[0011] Optionally, the platform types of the Git platform include GitHub, GitLab, Gitea and GitLink.

[0012] According to the above description, it covers a variety of common platform types, improves applicability and optimizes user experience.

[0013] Optionally, the current code editor is VS Code.

[0014] In a second aspect, the present invention provides a system for integrating Git platform functions into a code editor, comprising:

[0015] A parsing module is used to receive a plug-in loading instruction, complete the loading of the current plug-in according to the plug-in loading instruction, obtain the project file opened in the current code editor through the current plug-in, and perform configuration parsing on the project file to obtain a git configuration file;

[0016] The integration module is used to obtain the platform type of the Git platform according to the git configuration file, and call the API service matching the platform type through a unified API call interface to realize the function of integrating the Git platform into the current code editor.

[0017] The beneficial effect of the present invention is that: the project file opened in the current code editor is obtained by the loaded current plug-in, and the configuration of the project file is parsed to obtain the git configuration file, thereby automatically identifying the platform type of the Git platform, and dynamically matching and calling the API service corresponding to the platform type to realize the function of integrating the Git platform in the current code editor, that is, the user can use the function of the Git platform in the current code editor without switching between the code editor and the Git platform multiple times, completing the whole process operation in one stop, ensuring work continuity while simplifying operations and improving work efficiency, and when calling the API service, it is called through a unified API calling interface, ensuring that the user data status can be maintained when switching the Git platform later, and optimizing the user experience.

[0018] Optionally, the functions of the Git platform include user management function, issues management function, code merge management function, warehouse information management function and milestone management function.

[0019] According to the above description, splitting the functions of the Git platform into multiple separate functions can achieve a high cohesion and low coupling design and improve flexibility.

[0020] Optionally, the platform types of the Git platform include GitHub, GitLab, Gitea and GitLink.

[0021] According to the above description, it covers a variety of common platform types, improves applicability and optimizes user experience.

[0022] Optionally, the current code editor is VS Code. BRIEF DESCRIPTION OF THE DRAWINGS

[0023] Figure 1 A flowchart of a method for integrating Git platform functions into a code editor provided in this embodiment;

[0024] Figure 2 This is an overall flow chart of a method for integrating Git platform functions into a code editor provided in this embodiment;

[0025] Figure 3 An organizational chart of a method for integrating Git platform functions into a code editor provided in this embodiment;

[0026] Figure 4 This is a schematic diagram of the module structure of a system for integrating Git platform functions into a code editor provided by this embodiment.

[0027] [Description of Reference Numerals]

[0028] 1. A system that integrates Git platform functionality into a code editor;

[0029] 2. Parsing module;

[0030] 3. Integrated module. DETAILED DESCRIPTION

[0031] To better understand the above technical solutions, exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present invention are shown in the accompanying drawings, it should be understood that the present invention can be implemented in various forms and should not be limited by the embodiments described herein. Instead, these embodiments are provided to enable a clearer and more thorough understanding of the present invention and to fully convey the scope of the present invention to those skilled in the art.

[0032] Example 1

[0033] Please refer to Figures 1 to 3The present invention provides a method for integrating Git platform functions in a code editor, comprising the steps of:

[0034] S1. Receive a plug-in loading instruction, complete loading of the current plug-in according to the plug-in loading instruction, obtain a project file opened in the current code editor through the current plug-in, perform configuration analysis on the project file, and obtain a git configuration file;

[0035] In this embodiment, if Figure 2 As shown, when the user opens the current code editor, the plug-in loading instruction is received, and the current plug-in is loaded according to the plug-in loading instruction. The user opens the project file written in advance or in real time in the current code editor, obtains the project file through the loaded current plug-in, and performs configuration parsing on the project file to obtain the git configuration file. The current code editor is VS Code. When the current code editor is VS Code, the main program of the current plug-in is usually located in the extension.ts file or the extension.js file. Various modules developed by the user are registered in the activate method, and the activation time is configured in package.json. When the current plug-in needs to be published to the VSCode plug-in market or other platforms, it only needs to be packaged into a format that can be recognized by VS Code.

[0036] S2. Obtain the platform type of the Git platform according to the git configuration file, call an API service matching the platform type through a unified API call interface, and implement the function of integrating the Git platform into the current code editor.

[0037] In this embodiment, if Figures 2 to 3 As shown, the platform type of the Git platform is obtained according to the git configuration file obtained in step S1, where the platform types of the Git platform include but are not limited to GitHub, GitLab, Gitea and GitLink. A unified API call interface is designed in advance, and corresponding interface adapters are implemented for different platforms to ensure that the user data status can be maintained when the platform is switched. The API service matching the platform type is called through the unified API call interface to realize the function of integrating the Git platform in the current code editor.

[0038] The Git platform's functions include, but are not limited to, user management, issue management, code merge management, repository information management, and milestone management. User management is primarily responsible for user login and authentication, as well as maintaining user status. This functionality uses the vscode.window.showInputBox module provided by VS Code to display an input box, allowing users to enter their account and password to log in to their GitLink account. After login, user information is stored in the globalState to ensure persistent login status.

[0039] The issues management function is mainly responsible for obtaining, creating and updating issues. In the issues management function, it is divided into two parts: the Issues sidebar list and the Issues details page. The project repository issue list is obtained through the API provided by Git Link, and the issue list can be filtered, such as: select I created, select I am responsible for, and select the most recently released. Developers can view the issue content directly in the current code editor, modify the code directly according to the issues reported, and reply to and modify the issue status. The sidebar of the Issues sidebar list is registered in pac kage.json, and the vscode.window.registerTreeDataProvider API is used to register the tree view data provider. In the registered data provider IssueTreeDataProvider, the Issues sidebar list data is updated through the getChildren method. The getChildren method calls the corresponding API of GitLink, and different operations are performed according to the user's different selections of the issue list. At the same time, the list item is associated with the "openIssue" custom command, and the corresponding issue details are opened when the user clicks the list item. Issues details page: The Issues details page is implemented using the react framework. The page includes detailed information such as the issue revision, creator, person in charge, status, priority, tags, comments, etc., and authorized developers can manage the above details. The page is loaded by creating a webview through vscode.window.createWebviewPanel. The process of vscode.window.createWebviewPanel creating a webview is implemented in the "openIssue" custom command.

[0040] The code merge management function is mainly responsible for the creation, merging, and commenting of code merges. In the code merge function, it is divided into two parts: the list in the code merge sidebar and the code merge details page. The list of merge requests for the project repository is obtained through the API provided by GitLink, and the merge request list can be filtered, such as selecting all, selecting those waiting for my review, etc. Developers with merge permissions can directly view the content of the merge request, code differences, and perform operations such as code merging, rejection, and commenting on the merge request in the VS Code code editor; Code merge sidebar list: The sidebar is registered in package.json, and the vscode.window.registerTreeDataProvider API is used to register the tree view data provider. In the registered data provider PullRequestTreeDataProvider, the sidebar list data is updated through the getChildren method. In the getChildren method, the corresponding API of GilLink is called, and different operations are performed according to different selections of the user for the merge request list. At the same time, the list item is associated with the "openPullRequest" custom command, and when the user clicks on the list item, the corresponding merge request details are opened; Code merge details page: The code merge details page is also implemented using the react framework. The page includes detailed information such as merge request description, creator, reviewer, tag, priority, comment, commit list, modified file list, etc. Developers with code merge permissions can view and edit the above information, directly open the corresponding modified file comparison in VS Code, and perform code merging or rejection operations. The page is loaded by creating a webview through vscode.window.createWebviewPanel, and the process of creating the webview by vscode.window.createWebviewPanel is implemented in the "openPullRequest" custom command.

[0041] In this embodiment, if the user needs to integrate other functions of the Git platform, only need to build based on the above steps, using the API corresponding to the Git platform and the API of the current code editor: VS Code. At the same time, it supports the user to remove and modify the existing functions of the Git platform.

[0042] Embodiment 2

[0043] Please refer to Figure 4 , The present invention provides a system 1 for integrating the functions of the Git platform in a code editor, including: a parsing module 2 and an integration module 3.

[0044] The parsing module 2 is configured to receive a plug-in loading instruction, load the current plug-in according to the plug-in loading instruction, obtain the project file opened in the current code editor through the current plug-in, and perform configuration parsing on the project file to obtain a git configuration file.

[0045] Integration module 3 is used to obtain the platform type of the Git platform according to the git configuration file, and call the API service matching the platform type through a unified API call interface to realize the function of integrating the Git platform into the current code editor.

[0046] Specifically, the functions of the Git platform include user management function, issues management function, code merge management function, warehouse information management function and milestone management function.

[0047] Specifically, the platform types of the Git platform include GitHub, GitLab, Gitea and GitLink.

[0048] Specifically, the current code editor is VS Code.

[0049] Since the systems / devices described in the above embodiments of the present invention are systems / devices used to implement the methods of the above embodiments of the present invention, those skilled in the art will be able to understand the specific structures and variations of these systems / devices based on the methods described in the above embodiments of the present invention, and thus will not be described in detail here. All systems / devices used in the methods of the above embodiments of the present invention are within the scope of protection of the present invention.

[0050] Those skilled in the art will appreciate that embodiments of the present invention may be provided as methods, systems, or computer program products. Thus, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product implemented on one or more computer-usable storage media (including but not limited to magnetic disk storage, CD-ROM, optical storage, etc.) containing computer-usable program code.

[0051] The present invention is described with reference to flowcharts and / or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It should be understood that each process and / or block in the flowcharts and / or block diagrams, as well as combinations of processes and / or blocks in the flowcharts and / or block diagrams, can be implemented by computer program instructions.

[0052] It should be noted that, in the claims, any reference signs placed between brackets shall not be construed as limiting the claims. The word "comprising" does not exclude the presence of components or steps not listed in the claims. The word "a" or "an" preceding a component does not exclude the presence of a plurality of such components. The invention may be implemented by means of hardware comprising several different components and by means of a suitably programmed computer. In claims enumerating several means, several of these means may be embodied by one and the same hardware. The use of the words first, second, third etc. is for convenience only and does not indicate any order. These words may be understood as part of the component name.

[0053] In addition, it should be noted that, in the description of this specification, the description of the terms "one embodiment", "some embodiments", "embodiment", "example", "specific example" or "some examples" means that the specific features, structures, materials or characteristics described in conjunction with the embodiment or example are included in at least one embodiment or example of the present invention. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in any one or more embodiments or examples in a suitable manner. In addition, those skilled in the art can combine and combine different embodiments or examples described in this specification and the features of different embodiments or examples, unless they are contradictory.

[0054] Although the preferred embodiments of the present invention have been described, those skilled in the art may make additional changes and modifications to these embodiments after learning the basic creative concept. Therefore, the claims should be interpreted as including the preferred embodiments and all changes and modifications that fall within the scope of the present invention.

[0055] Obviously, those skilled in the art may make various modifications and variations to the present invention without departing from the spirit and scope of the present invention. Thus, if such modifications and variations fall within the scope of the claims and their equivalents, the present invention shall also include such modifications and variations.

Claims

1. A method for integrating Git platform functions in a code editor, characterized in that: include: Receive a plug-in loading instruction, complete the loading of the current plug-in according to the plug-in loading instruction, obtain the project file opened in the current code editor through the current plug-in, perform configuration analysis on the project file, and obtain a git configuration file; The platform type of the Git platform is obtained according to the git configuration file, and an API service matching the platform type is called through a unified API calling interface to implement the function of integrating the Git platform into the current code editor.

2. A method for integrating Git platform functions in a code editor as claimed in claim 1, characterized in that: The functions of the Git platform include user management function, issues management function, code merging management function, warehouse information management function and milestone management function.

3. A method for integrating Git platform functions in a code editor as claimed in claim 1, characterized in that: The platform types of the Git platform include GitHub, GitLab, Gitea and GitLink.

4. A method for integrating Git platform functions in a code editor as claimed in claim 1, characterized in that: The current code editor is VS Code.

5. A system for integrating Git platform functions in a code editor, characterized in that: include: A parsing module is used to receive a plug-in loading instruction, complete the loading of the current plug-in according to the plug-in loading instruction, obtain the project file opened in the current code editor through the current plug-in, perform configuration parsing on the project file, and obtain a git configuration file; The integration module is used to obtain the platform type of the Git platform according to the git configuration file, and call the API service matching the platform type through a unified API call interface to realize the function of integrating the Git platform in the current code editor.

6. A system for integrating Git platform functions in a code editor as claimed in claim 5, characterized in that: The functions of the Git platform include user management function, issues management function, code merging management function, warehouse information management function and milestone management function.

7. A system for integrating Git platform functions in a code editor as claimed in claim 5, characterized in that: The platform types of the Git platform include GitHub, GitLab, Gitea and GitLink.

8. A system for integrating Git platform functions in a code editor as claimed in claim 5, characterized in that: The current code editor is VS Code.