Resolved an issue where the incorrect debugging environment was generated for VSCode in "Auto" mode // Resolve #4597

This commit is contained in:
Ivan Kravets
2023-04-12 22:21:51 +03:00
parent 5c3ae15bee
commit 66fe55668e
4 changed files with 9 additions and 6 deletions

View File

@@ -26,7 +26,8 @@ PlatformIO Core 6
* Implemented a fix for shell injection vulnerabilities when converting INO files to CPP, ensuring your code is safe and secure (`issue #4532 <https://github.com/platformio/platformio-core/issues/4532>`_)
* Restored the project generator for the `NetBeans IDE <https://docs.platformio.org/en/latest/integration/ide/netbeans.html>`__, providing you with more flexibility and options for your development workflow
* Resolved an issue where the `build_cache_dir <https://docs.platformio.org/en/latest/projectconf/sections/platformio/options/directory/build_cache_dir.html>`__ setting was not being recognized consistently across multiple environments (`issue #4574 <https://github.com/platformio/platformio-core/issues/4574>`_)
* Fixed an issue where organization details could not be updated using the `pio org update <https://docs.platformio.org/en/latest/core/userguide/org/cmd_update.html>`__ command, ensuring that your organization's information remains up-to-date and accurate
* Fixed an issue where organization details could not be updated using the `pio org update <https://docs.platformio.org/en/latest/core/userguide/org/cmd_update.html>`__ command
* Resolved an issue where the incorrect debugging environment was generated for VSCode in "Auto" mode (`issue #4597 <https://github.com/platformio/platformio-core/issues/4597>`_)
6.1.6 (2023-01-23)
~~~~~~~~~~~~~~~~~~

2
docs

Submodule docs updated: 2c2cc23f42...6647f6e074

View File

@@ -16,7 +16,7 @@
% "request": "launch",
% "name": "PIO Debug (skip Pre-Debug)",
% "executable": _escape_path(prog_path),
% "projectEnvName": env_name,
% "projectEnvName": env_name if forced_env_name else default_debug_env_name,
% "toolchainBinDir": _escape_path(os.path.dirname(gdb_path)),
% "internalConsoleOptions": "openOnSessionStart",
% }
@@ -28,7 +28,7 @@
% debug["name"] = "PIO Debug"
% debug["preLaunchTask"] = {
% "type": "PlatformIO",
% "task": ("Pre-Debug (%s)" % env_name) if len(config.envs()) > 1 and original_env_name else "Pre-Debug",
% "task": ("Pre-Debug (%s)" % env_name) if len(config.envs()) > 1 and forced_env_name else "Pre-Debug",
% }
% noloading = predebug.copy()
% noloading["name"] = "PIO Debug (without uploading)"

View File

@@ -19,6 +19,7 @@ import sys
import bottle
from platformio import fs, util
from platformio.debug.helpers import get_default_debug_env
from platformio.proc import where_is_program
from platformio.project.helpers import load_build_metadata
@@ -27,7 +28,7 @@ class ProjectGenerator:
def __init__(self, config, env_name, ide, board_ids=None):
self.config = config
self.project_dir = os.path.dirname(config.path)
self.original_env_name = env_name
self.forced_env_name = env_name
self.env_name = str(env_name or self.get_best_envname(board_ids))
self.ide = str(ide)
@@ -86,7 +87,8 @@ class ProjectGenerator:
"platformio", "name", os.path.basename(self.project_dir)
),
"project_dir": self.project_dir,
"original_env_name": self.original_env_name,
"forced_env_name": self.forced_env_name,
"default_debug_env_name": get_default_debug_env(self.config),
"env_name": self.env_name,
"user_home_dir": os.path.abspath(fs.expanduser("~")),
"platformio_path": sys.argv[0]