.. _vscode: 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 :ref:`docker`) Installation ------------ Enther the `VSCode download`_ website and download the correct installer for your system and install VSCode. Configuration ------------- #. Install useful Visual Studio Code Extensions by executing on the host system: .. tab:: Ubuntu .. code-block:: ./utils/vscode/vscode-extension-install.sh .. tab:: Windows .. code-block:: .\utils\vscode\vscode-extension-install.bat #. Edit your workspace settings. Press ``Strg + Shift + P`` and choose ``Open Workspace Settings (JSON)`` entry This is a recommended settings set: .. code-block:: json { "editor.rulers": [120], "workbench.colorCustomizations": { "editorRuler.foreground": "#ff01b3", "tree.indentGuidesStroke": "#01fff2" }, "workbench.tree.indent": 20, } .. _vscode-as-ros-container: Connect to an AS ROS container with VSCode ------------------------------------------ #. You atleast have to install VSCode with the ``Dev Containers`` Extension. It is recommended and assumed that you setup the VSCode as desribed above. #. 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. #. Attach to the respective, wanted container in the current or in a new windows. #. This may take a while, since an VSCode server has to be installed inside the container. Wait for this to complete before you continue #. Install useful, recommended and required VSCode Extensions by executing in the docker container: .. code-block:: /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. #. Open ``/workspace/as_ros/`` as folder. #. Edit your workspace settings. Press ``Strg + Shift + P`` and choose ``Open Workspace Settings (JSON)`` entry This is a recommended settings set: .. code-block:: json { "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", ], } #. You are ready to go. .. _VSCode download: https://code.visualstudio.com/download