Visual Studio Code

Installation

1) Start Visual Studio Code 2) Open the Command Palette from the menu View > Command Palette and execute Developer: Install Extension from location .../ 3) Select the folder com.digitalsubstrate.viper/dsm_vscode

Theme Dracula (Optional)

1) Open the Command Palette and execute 'Browse Color Theme in MarketPlace' 2) Select Theme Dracula

Additional user settings (Optional)

Add those settings in settings.json.

1) Open the Menu Code > Settings > Profiles 2) Select Default profile 3) Then click settings to browse your settings. 4) Then add custom color and style to emphasize a key, uuid and enum case.

{ // Root Object
  ...
  // Added settings for token customization
  "editor.tokenColorCustomizations": {
    "textMateRules": [
      {
        "scope": "variable.key.dsm",
        "settings": {
          "fontStyle": "underline"
        }
      },
      {
        "scope": "constant.uuid.dsm",
        "settings": {
          "fontStyle": "underline"
        }
      },
      {
        "scope": "constant.enum.dsm",
        "settings": {
          "fontStyle": "italic"
        }
      },
    ]
  },
  ...
  // "workbench.colorTheme": "Dracula", recommended Theme
}

Define a build task to check DSM syntax

The minimal content of the file tasks.json to check the DSM syntax with dsm_check.

{
    // See https://go.microsoft.com/fwlink/?LinkId=733558
    // for the documentation about the tasks.json format
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Check DSM Syntax",
            "type": "shell",
            "command": "python",
            "args": [
                "../tools/dsm_util.py",
                "check",
                "${file}"
            ],
            "presentation": {
                "reveal": "never",
                "revealProblems":"onProblem"
            },
            "problemMatcher": "$dsm",
            "group": {
                "kind": "build",
                "isDefault": true,
            }
        }
    ]
}

DSM snippets

The extension defines snippets to simplify the generation of the mandatory Definition ID required by a definition.

Prefix Documentation
namespace Create a namespace with an uuid
enum Create a enum
struct Create a struct
concept Create a concept
club Create a club
membership Create a membership
attachment Create a attachment
aid Create an uuid
function_pool Create a pool of function with an uuid
commit_function_pool Create a pool of commit function with an uuid

Other snippets are available for primitive types and generic types.