VS Code Quickly Write Code Generation Plugin CodeGeeX User Guide

       CodeGeeX is a multi-programming language code generation pre-training model with 13 billion parameters, trained using more than twenty programming languages. The plug-in developed based on CodeGeeX can realize a series of functions such as generating code through description, completing code, and translating code. CodeGeeX also provides a customizable prompt mode (Prompt Mode) to build an exclusive programming assistant. Happy Coding!

Search "CodeGeex" in the VS Code plug-in market to use it for free (VS Code version not lower than 1.68.0 is required). For more information about CodeGeeX, please private message.

If you encounter problems during use or have any suggestions for improvement, please send suggestions to Wx: 18634371151 for feedback!


basic usage

It is necessary to ensure that the VS Code version >= 1.68.0. Install the plugin and activate CodeGeeX globally, there are four usage modes:

  • Automatic mode: Keep CodeGeeX active, when you stop typing, it will start generating from the current cursor position (the CodeGeeX icon in the lower right corner circles to indicate that it is generating). After the generation is complete, it will be displayed in gray, press Tab to insert the generated result.
  • Interactive mode: Press Ctrl+Enter to activate the interactive mode, CodeGeeX will generate X candidates and display them in the right window (the number of X can be modified in the Candidate Num setting). Click the use code above the candidate code to insert it.
  • Translate mode: Select the code, then press Ctrl+Alt+T to activate the translate mode, CodeGeeX will translate the code into the code that matches your current editor language. Click the use code above the translation results to insert. You can also choose in the settings what you want to do with translated code when inserting, you can choose to comment them or override them.
  • Prompt mode (experimental function): Select the code that needs to be input, press Alt/Option+t to trigger the prompt mode, a list of predefined templates will be displayed, select one of the templates, and the code can be inserted into the template for generation. This mode is highly customizable, and you can modify or add template content in Prompt Templates in the settings to add additional prompts to the model.

Privacy statement

      We highly respect the privacy of user code, and the code is only used to assist programming. When you use it for the first time, we will ask you to agree to use the generated code for research purposes to help CodeGeeX become better (this option is turned off by default).

user's guidance

      The following are the detailed usage of CodeGeeX several modes: 

      1. Automatic mode

         Keep CodeGeeX active, and when you stop typing, it will start generating from the current cursor position (the CodeGeeX icon in the lower right corner circles to indicate that it is generating). After the generation is complete, it will be displayed in gray, press Tab to insert the generated result.

          Specific operation steps: CodeGeeX will start generating from the cursor when you stop typing (the CodeGeeX icon in the lower right corner circles to indicate that it is generating). After the generation is complete, it will be displayed in gray. If you are satisfied with the result, press "Tab" to insert the generated result. , duration 02:30 When multiple candidates are generated, you can use "Alt/Option+[" or "]" to switch between several candidates. User can also change "Candidate Num" in settings. If you are not satisfied with an existing suggestion, you can use "Alt/Option+N" to get a new candidate.

        2. Interactive mode 

           Specific operation steps: Activate the interactive mode through "Ctrl+Enter", CodeGeeX will generate "X" candidates and display them in the right window (the number of "X" can be modified in the "Candidate Num" setting). Click "use code" above the candidate code to insert the result at the current cursor position.

        3. Translation mode

      This mode helps you translate from one language to another, such as translating an algorithm written in C++ to Python, without having to type it out yourself. 

      Select the code, then press Ctrl+Alt+T to activate the translation mode, and CodeGeeX will translate the code into code that matches your current editor language. Click the use code above the translation results to insert. You can also choose in the settings what you want to do with translated code when inserting, you can choose to comment them or override them.

         4. Prompt mode

       This mode can imitate the input code to achieve corresponding functions, such as quickly explaining large sections of code. The principle of this mode is to use CodeGeeX's powerful few-sample generation capabilities.         

       Select the code that needs to be input, press Alt/Option+t to trigger the prompt mode, a list of predefined templates will be displayed, select one of the templates, and the code can be inserted into the template for generation. This mode is highly customizable, you can modify or add template content in Prompt Templates in the settings, and add additional prompts to the model. 


         Template files are highly customizable, you can add custom templates to "Prompt Templates" in the plugin settings. "key" indicates the name of the template, "value" is the path of the template file (this path is not unique, it can be any path on your computer, ".txt", ".py", ".h" and other format files are all Can).

Guess you like

Origin blog.csdn.net/YN2000609/article/details/131904440