1.3.2. Visual Studio Code as standardized IDE

As already described we use Visual Studio Code as Standardized IDE. It is assumed that you already have a running docker container (see Our Docker Environment Explained)

1.3.2.1. Installation

Enther the VSCode download website and download the correct installer for your system and install VSCode.

1.3.2.2. Configuration

  1. Install useful Visual Studio Code Extensions by executing on the host system:

    ./utils/vscode/vscode-extension-install.sh
    
    .\utils\vscode\vscode-extension-install.bat
    
  2. Edit your workspace settings. Press Strg + Shift + P and choose Open Workspace Settings (JSON) entry

    This is a recommended settings set:

    {
       "editor.rulers": [120],
       "workbench.colorCustomizations": {
          "editorRuler.foreground": "#ff01b3",
          "tree.indentGuidesStroke": "#01fff2"
       },
       "workbench.tree.indent": 20,
    }
    

1.3.2.3. Connect to an AS ROS container with VSCode

  1. You atleast have to install VSCode with the Dev Containers Extension. It is recommended and assumed that you setup the VSCode as desribed above.

  2. Click on the Remote Extension (Display with >< in a small circle) in the sidebar and choose Containers in the REMOTE EXPLORER dropdown at the top.

  3. Attach to the respective, wanted container in the current or in a new windows.

  4. This may take a while, since an VSCode server has to be installed inside the container. Wait for this to complete before you continue

  5. Install useful, recommended and required VSCode Extensions by executing in the docker container:

    /workspace/as_ros/docs/source/getting_started/dev_environment/vscode/vscode-extension-install.sh
    

    If this is not working, open the Extensions sidebar (Icon with four squares). Install all locally installed extension inside the container: Click on the cloud icon with the arrow directed downwards.

    Also search for lextudio.restructuredtext and trond-snekvik.simple-rst install them.

  6. Open /workspace/as_ros/ as folder.

  7. Edit your workspace settings. Press Strg + Shift + P and choose Open Workspace Settings (JSON) entry

    This is a recommended settings set:

    {
       "esbonio.sphinx.buildDir": "/workspace/as_ros/docs/build/",
       "esbonio.sphinx.confDir": "/workspace/as_ros/docs/source/",
       "esbonio.sphinx.srcDir": "/workspace/as_ros/docs/source/",
       "esbonio.server.showOutputOnError": true,
       "restructuredtext.linter.doc8.extraArgs": [
          "--config",
          "${workspaceFolder}/docs/source/doc8.ini"
          ],
       "ros.rosSetupScript": "/workspace/as_ros/devel/setup.bash",
       "editor.rulers": [120],
       "workbench.colorCustomizations": {
          "editorRuler.foreground": "#ff01b3",
          "tree.indentGuidesStroke": "#01fff2"
       },
       "workbench.tree.indent": 20,
       "pythonIndent.trimLinesWithOnlyWhitespace": true,
       "pythonIndent.keepHangingBracketOnLine": true,
       "autoDocstring.docstringFormat": "numpy",
       "autoDocstring.startOnNewLine": true,
       "autoDocstring.includeExtendedSummary": true,
       "python.autoComplete.extraPaths": [
          "/workspace/as_ros/devel/lib/python3/dist-packages",
          "/opt/ros/noetic/lib/python3/dist-packages",
          "/workspace/as_ros/src/control/forces_pro_client"
       ],
       "python.analysis.extraPaths": [
          "/workspace/as_ros/devel/lib/python3/dist-packages",
          "/opt/ros/noetic/lib/python3/dist-packages",
          "/workspace/as_ros/src/control/forces_pro_client"
       ],
       "python.linting.flake8Enabled": true,
       "python.linting.enabled": true,
       "python.linting.flake8Args": [
          "--max-line-length=120",
          "--ignore=ANN101,W503",
          "--suppress-none-returning",
       ],
    }
    
  8. You are ready to go.