Updated on 2026-09-15 GMT+08:00

Visual Studio Code

Preparations

  • Download and install Visual Studio Code 1.95.3 (November 13, 2024) or later.
  • Operating system: Windows 10 (x64, 2019 or later) or Windows 11 (x64)

Step 1: Install and Log In to the Plug-in

  1. Start Visual Studio Code and click the extensions icon in the sidebar.
  2. In the search box, enter CodeArts Agent and press Enter.
  3. In the search result, find the plug-in and click Install.

    If the icon is displayed in the Visual Studio Code sidebar, the plug-in is successfully installed.

  4. Click the icon in the sidebar to bring up the chat window.
  5. Click HUAWEI ID Login. Your browser will launch automatically. Enter your HUAWEI ID and password to log in.

    If you are using CodeArts Agent for the first time, the system will automatically activate the free package upon your successful login. If you want to unlock more advanced features, you can upgrade your package at any time from the Subscriptions page.

  6. Create a project to store files in the project.

Step 2: Try CodeArts Agent

The following three examples will give you a hands-on feel for the powerful capabilities of Huawei Cloud CodeArts Agent.

Developing a Web Page with the Agent

You only need to describe your requirements (for example, developing a clean frontend login page). The agent can automatically plan the logic, write code, and generate a directly executable program.

  1. Click to open the chat window, switch to the Agent mode, and then switch to the Vibe Coding mode.
  2. Enable AI-based automation.

    1. Click in the upper right corner to access the settings page.
    2. Choose Dialog Flow > Agent > Auto-approve, and click to enable the items required for automatic approval, including editing, browser access, and the web page content capture tool.

  3. Send your requirements to AI.

    Develop a clean frontend login page.

  4. After the page is created, find the generated login.html file in the Explorer on the left, right-click the file, and choose Reveal in File Explorer. Double-click and open the login.html file to view the login page.

Generating Code and Inquiring R&D Knowledge

  1. Click the icon in the sidebar to open the chat window and switch to the Ask mode.
  2. Send your requirements to AI.

    Analyze what a binary tree is and write a Python code example.

  3. The chat window returns the binary tree explanation and a Python code example. Click the Insert icon in the upper-right corner of the code block to add the code directly to a new file.

    Figure 1 Generation effect

  4. You can ask follow-up questions based on the AI's response to continue the multi-turn conversation. For example, you can continue to send requirements to the AI.

    Rewrite the generated Python code in Java.
    Figure 2 Generated Java code

Completing Code

You can use AI to autocomplete Java code for computing the nth Fib4 number using context or inline comments.

  1. Create a Java class file (for example, Solution.java). Enter the following code in the code editor:

    public class Solution {
        /**
         The Fib4 number sequence is a sequence similar to the Fibonacci sequence that's defined as follows:
         fib4(0) -> 0
         fib4(1) -> 0
         fib4(2) -> 2
         fib4(3) -> 0
         fib4(n) -> fib4(n-1) + fib4(n-2) + fib4(n-3) + fib4(n-4).
         Please write a function to efficiently compute the n-th element of the fib4 number sequence. Do not use recursion.
         >>> fib4(5)
         4
         >>> fib4(6)
         8
         >>> fib4(7)
         14
         */
        public int fib4(int n) {
    }
    }

  2. Press Alt+C after public int fib4(int n) {. The AI will generate the corresponding code in the editor based on your comment.

    To obtain more accurate and complete multi-line code generation, you are advised to enrich the code comments.
    Figure 3 Code completion effect

  3. If you accept the current code suggestion, press Tab or click Accept in the editing area to apply it.

    Figure 4 Accepting the code completion suggestion