JB tools: transform some incorrectly sent empty strings in params to None

In Move and SafeDelete, the client might send an empty string instead of None
This commit is contained in:
Michael Panchenko committed 2026-04-16 13:44:04 +02:00
1 parent f0d92bfca8
commit 1f95613b11
2 files changed
+9 -2

No files matched your search

+5 -2
View File
@@ -7,6 +7,9 @@ Status of the `main` branch. Changes prior to the next official version change w
- Fix: Check for ignored path ignored `.git` folder only at the top level, not in every subdirectory (`Project._is_ignored_relative_path`) #1350
- Fix: Duplicate comments in re-saved YAML configuration files #1285
* JetBrains:
- `Move` and `SafeDelete` tools: transform empty string to None (counteracts client errors)
* Dependencies:
- `pywebview`: Switch back to official release (new version 6.2) #1253
@@ -20,10 +23,10 @@ Status of the `main` branch. Changes prior to the next official version change w
- Fix: When scanning for `.gitignore` files, the presence of files that could not be made relative
to the project root would cause the scan to fail. #1317
Dashboard:
* Dashboard:
- Fix handling of read news, saving each read news entry separately #1338
JetBrains:
* JetBrains:
- Improve handling of `relative_path` parameter
- Improve its documentation to avoid usage errors
- Replace escaped characters in `relative_path` with their unescaped counterparts (< and >)
+4
View File
@@ -159,6 +159,9 @@ class JetBrainsMoveTool(Tool, ToolMarkerSymbolicEdit, ToolMarkerOptional, ToolMa
:param target_relative_path: the relative path of the target directory or file.
:param target_parent_name_path: the name path of the target parent symbol.
"""
name_path = name_path or None
target_relative_path = target_relative_path or None
target_parent_name_path = target_parent_name_path or None
relative_path = self._sanitize_input_param(relative_path)
with JetBrainsPluginClient.from_project(self.project) as client:
response_dict = client.move(
@@ -199,6 +202,7 @@ class JetBrainsSafeDeleteTool(Tool, ToolMarkerSymbolicEdit, ToolMarkerOptional,
remove symbols that become unused after the deletion. Default is False.
"""
relative_path = self._sanitize_input_param(relative_path)
name_path = name_path or None
with JetBrainsPluginClient.from_project(self.project) as client:
response_dict = client.safe_delete(
name_path=name_path,