From 7f88317945bbfb628adef666332fb17acbd120c0 Mon Sep 17 00:00:00 2001 From: dgtal1 <27864579+dgtal1@users.noreply.github.com> Date: Tue, 3 Jan 2023 23:33:49 +0100 Subject: [PATCH] Add notes about debugging HA in Dev Container (#1469) * Add notes about debugging HA in Dev Container Since some people (like me and others) experience issues with the default Dev Container debugging, whcih doesn't work out-of-the box - new developers may think that debugging is not supported by the dev container out-of-the-box. This description is to indicate that normally debugging doesn't needs any additional actions to be taken to enable it. I also mentioned the way to debug remote instances, which may be very helpful for the developers, also in case of issues with the default debugging without enabling `debugpy`. If I had such description I wouldn't loose almost 2 hours of googling trying to find out what is supported and what are the options, so I hope thanks to this people will avoid this. * Fix typo in my previous description * Small tweaks Co-authored-by: Franck Nijhof --- docs/development_environment.mdx | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/development_environment.mdx b/docs/development_environment.mdx index ff1c41b7..73e4b655 100644 --- a/docs/development_environment.mdx +++ b/docs/development_environment.mdx @@ -44,6 +44,12 @@ The devcontainer comes with some useful tasks to help you with development, you When a task is currently running (like `Preview` for the docs), it can be restarted by opening the command palette and selecting `Tasks: Restart Running Task`, then select the task you want to restart. +### Debugging with Visual Studio Code + +If the Dev Container was set up correctly - it supports debugging by default, out-of-the-box. It provides the necessary debug configurations, so hitting F5 should launch Home Assistant. Any breakpoints put in the code should be triggered, and the debugger should stop. + +It is also possible to debug a remote Home Assistance instance (e.g., productive instance) by following the procedure described [here](https://www.home-assistant.io/integrations/debugpy/). + ## Manual Environment _You only need these instructions if you do not want to use devcontainers._