C3 AI VS Code ExtensionThis is the official VS Code extension for development on the C3 AI Platform. The extension enhances the application development experience on the C3 AI Platform by providing C3 Type System-specific aid across type files and implementation files. These include code completion, in-text documentation, testing and debugging capabilities, and other developing utilities. For more information on C3 AI, visit our website.
Get StartedBefore developing an application on the C3 AI Platform, make sure to meet the prerequisites:
Install the extensionTo install, select the Extensions icon in VS Code and search for C3 AI Development Experience V8. It is best practice to have the latest version of the extension. If the server version is incompatible with the newest version of the extension, you can install an older version of the extension on this page. Setup the local workspaceThe local workspace is where you store your C3 AI application package code. Ensure that you have a workspace (a folder) in your local machine that follows the following structure, where LocalWorkspace represents the directory that contains the package(s) that you are working on.
Create an environmentApplication development is done by connecting to a Dedicated Development Environment (DDE). Once connected to a DDE, you will be able to instantly start applications based on the packages in your workspace. Environments can be created via C3 AI Studio; below is an example of DDE creation in Studio.
Connect and syncOnce the extension is installed, a pop-up welcome page launches allowing you to select or confirm your workspace and enter your environment URL.
Upon successful connection and sync, you should see the following message in the notification box as well as within the output tab. Additionally, you will also see the package explorer in the C3 AI tab populate with your local and external (dependency) packages.
Now you are ready to start building applications! Advanced Settings
On the welcome page, there are a few advanced settings options, as shown below.
Review validationAfter the synchronization process, the remote environment will begin to validate all the new files that it has received. During this process, you will see the icons on the files in the Package Explorer transition across a few states outlined below.
C3 AI VSCE FeaturesUpon successful connection, you should be able to test out the following features. There are 3 main areas that are useful within the C3 AI tab: The Package Explorer (1), the Tester (2), and the Panel (3) tabs (which contain C3 AI: Metadata Issues , C3 AI: Test Results, and Output).
Package ExplorerThe package explorer is first (1) section highlighted above. Once you have an established connection, you should see a list of your local packages as well as any dependencies from the server (for example, the platform package). This is also the recommended interface for interacting with your packages (over the native file explorer). From here you should be able to do the following:
TesterThe tester is second (2) section highlighted above. This is where you can queue up a list of test files to run, execute test files and view the history of the last 10 test runs. There are 2 tabs: Queue and History. Via the test queue, you can interact with a set of test files by:
You can also interact with individual test files in a similar fashion. Via the test history tab, you review the results of the last 10 test files that you’ve run. Clicking on a specific test file result will open the output tab with the detailed results. Panel TabThe panel is third (3) section highlighted in the image above. This section has multiple tabs within it that are relevant to the C3 developers. These include Output, C3 AI: Metadata Issues, and C3 AI: Test Results. OutputThis tab provides logging information to let users know what is happening when they are using the extension. During the initial connection and sync, it will provide insight into which stage of the process the user is in. Additionally, upon making metadata changes, the output tab provides instant feedback regarding the synchronization of files.
Metadata IssuesThis tab regularly updates with any syntax or deployment errors that your code has. This is a good one to keep open as you make changes within your application.
Test ResultsThis tab provides two views, one for the test results and the other for server logs. The first view provides the status and result information for any tests that you run. If there is an error the line where the error is located is presented. The second view outputs a server log snapshot of the test run.
Developer UtilitiesThe extension provides several C3 Type specific IntelliSense features including the following:
JS NotebookA new preview feature that we have enabled is the integrated JS Notebook. It will automatically connect to your remote environment and will allow you to run JS console commands and Type APIs within VS Code. You will also be able to switch context to any applications that you start within your DDE. To interact with your remote environments and applications from within VS Code open a new JS notebook by clicking on the notebook icon as shown below.
Once in the notebook, you can run Type APIs as you would on the console. For example, see the screenshot below. To run commands against another application within your connected environment click on the
FeedbackWe are constantly working to improve the extension by fixing bugs and adding new features. If you have any feedback that you wish to share with the developer team, please reach out to us at https://support.c3.ai/. |