Skip to content

Commit 161806c

Browse files
committed
fix: update of RobotCode icon in status bar when Python environment is changed
1 parent b9a3f10 commit 161806c

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

packages/runner/src/robotcode/runner/cli/discover/discover.py

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -759,6 +759,7 @@ class Info:
759759
robot_env: Dict[str, str]
760760
robotcode_version_string: str
761761
python_version_string: str
762+
executable: str
762763
machine: str
763764
processor: str
764765
platform: str
@@ -782,7 +783,6 @@ def info(
782783
robotcode discover info
783784
```
784785
"""
785-
import pprint
786786

787787
from robot.version import get_version as get_version
788788
from robotcode.core.dataclasses import as_dict
@@ -799,11 +799,18 @@ def info(
799799
if "ROBOT_INTERNAL_TRACES" in os.environ:
800800
robot_env["ROBOT_INTERNAL_TRACES"] = os.environ["ROBOT_INTERNAL_TRACES"]
801801

802+
executable = str(sys.executable)
803+
try:
804+
executable = str(Path(sys.executable).relative_to(Path.cwd()))
805+
except ValueError:
806+
pass
807+
802808
info = Info(
803809
get_version(),
804810
robot_env,
805811
__version__,
806812
platform.python_version(),
813+
executable,
807814
platform.machine(),
808815
platform.processor(),
809816
sys.platform,
@@ -812,7 +819,9 @@ def info(
812819
)
813820

814821
if app.config.output_format is None or app.config.output_format == OutputFormat.TEXT:
815-
app.echo_via_pager(pprint.pformat(as_dict(info, remove_defaults=True), compact=True, sort_dicts=False))
822+
for key, value in as_dict(info, remove_defaults=True).items():
823+
app.echo_via_pager(f"{key}: {value}")
824+
816825
# app.print_data(info, remove_defaults=True)
817826
else:
818827
app.print_data(info, remove_defaults=True)

vscode-client/languageclientsmanger.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ export interface ClientStateChangedEvent {
7979
interface DiscoverInfoResult {
8080
robot_version_string?: string;
8181
python_version_string?: string;
82+
executable?: string;
8283
machine?: string;
8384
platform?: string;
8485
system?: string;
@@ -129,6 +130,7 @@ export class LanguageClientsManager {
129130
const folder = vscode.workspace.getWorkspaceFolder(uri);
130131
let needsRestart = false;
131132
if (folder !== undefined) {
133+
this._workspaceFolderDiscoverInfo.delete(folder);
132134
needsRestart = this._pythonValidPythonAndRobotEnv.has(folder);
133135
if (needsRestart) this._pythonValidPythonAndRobotEnv.delete(folder);
134136
}
@@ -725,6 +727,7 @@ export class LanguageClientsManager {
725727
`
726728
- **Robot Framework**: ${info.robot_version_string}
727729
- **Python**: ${info.python_version_string}
730+
- **Python Executable**: ${info.executable}
728731
- **Platform**: ${info.platform}
729732
- **Machine**: ${info.machine}
730733
- **System**: ${info.system}

0 commit comments

Comments
 (0)