IBM / solution-editor-vscode-extension

Documentation and issue hosting for IBM's Solution Builder VS Code Extension
Other
0 stars 0 forks source link

IBM Cloud Solution Editor Beta

IBM Cloud Solution Editor extension for Visual Studio Code helps you customize your IBM Cloud infrastructure by providing syntax highlighting, linting, module management, and code completion for your deployable architecture.

This is an experimental feature that is available for evaluation and testing purposes and might change without notice.

Use this extension to build and customize your deployable architecture by editing your blueprint YAML file and adding modules and input values. Solution Editor currently supports text editing of IBM Cloud Schematics blueprint YAML files.

Prerequisites

Features

Definitions

Getting started with your blueprint YAML

  1. Locally clone the repos that contain your blueprint YAML source files.
  2. In VS Code, click the Explorer icon, or select View > Explorer.
  3. Open the local folder that contains the blueprint YAML file.
  4. Open your blueprint YAML file.
  5. In the File Explorer, open the Outline view.
  6. In the Solution section, double-click an element in the Outline view. The cursor is placed on the corresponding line of code in the blueprint YAML file.

The Solution section represents the structure (symbol tree) of the blueprint YAML file.

Adding modules to your blueprint

  1. View modules by clicking the IBM Cloud Solution Editor icon in the Activity Bar. Each module has additional metadata that Solution Editor reads and displays.
  2. Use the buttons in the catalog explorer view to perform various actions (hover over them to see what they do). For example, Refresh, Search, Reset, Expand, and Collapse.
  3. When you expand or hover over a module name, click either of the following icons: Opens a browser page to the module's repository for viewing its documentation. Pastes a full snippet of the selected module into the end of your YAML file.
  4. Press Ctrl+Space to show completions, which are a list of Inputs and Values that work in a specific “value” field.

Creating an empty blueprint

This feature creates a YAML file with a outline of a blueprint.

You can create an empty blueprint in the following ways:

You must save the file before you can use the editor features.

Inserting a Terraform module snippet into a blueprint

You provide a GitHub repository URL to a Terraform module, and the snippet is pasted into an open blueprint. The snippet contains all the module's variables as inputs and all the outputs with associated metadata. This option works only if you have a blueprint YAML file open and active.

Use the Command Palette (select View > Command Palette), and then select Insert a Terraform module snippet into a blueprint.

Troubleshooting your code

The IBM Cloud Solution Editor extension uses Code Actions, Quick Fixes, and squiggly lines to guide you to issues in your code that you need to fix.

After you enable the Solution Editor extension in VS Code, any time you open a blueprint YAML file in VS Code, the extension automatically checks the file for any coding issues. The problematic code is underlined with a squiggly line, which you can hover over to see more details about what the problem is and how to fix it. Different colors of squiggly lines indicate the type of problem:

VS Code also highlights the warnings in a few other places throughout the editor:

Using Code Actions

If a Code Action or Quick Fix is available, a yellow lightbulb icon appears when you hover over the warning in your file.

To use a specific Code Action or Quick Fix, click the lightbulb icon and select an action, such as Select the first available matching output or Learn more about the <module name> module….

The Learn more Quick Fix opens a browser window that redirects you to the public GitHub repository for that specific module. If VS Code prompts you to consent to opening the web page before redirecting you, click Open.

To pop up a menu of Quick Fix suggestions, use these keyboard shortcuts:

Accessing log files

Logs are located in the Output panel. To open the Output panel, click View > Output (Shift+Command+U).

From the output channel dropdown, select the following logs:

You can change the log level by using Developer: Set Log Level... in the Command Palette (View > Command Palette).

This extension also creates logs in the file system: