Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions packages/roboview/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ license = "Apache 2.0"
authors = ["viadee Unternehmensberatung AG"]
readme = "README.md"

packages = [
{ include = "roboview" }
]

[tool.poetry.dependencies]
python = ">=3.10,<3.14"
robotframework = "^7.2.2"
Expand Down
10 changes: 5 additions & 5 deletions vscode-integration/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# RoboView - Keyword Management in Robot Framework
![banner](./static/github_banner.png)
![banner](./resources/github_banner.png)
[![PyPI version](https://img.shields.io/pypi/v/robotframework-roboview.svg)](https://pypi.org/project/robotframework-roboview/)
![license](https://img.shields.io/badge/license-Apache--2.0-green)
![python](https://img.shields.io/badge/python-3.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue)
Expand Down Expand Up @@ -73,10 +73,10 @@ The **Dashboard** gives you a high‑level overview of the selected Robot Framew


<p align="center">
<img src="./static/dashboard_1.png" alt="keyword_list" width="900"/>
<img src="./resources/dashboard_1.png" alt="keyword_list" width="900"/>
</p>
<p align="center">
<img src="./static/dashboard_2.png" alt="keyword_list" width="900"/>
<img src="./resources/dashboard_2.png" alt="keyword_list" width="900"/>
</p>

<br>
Expand Down Expand Up @@ -108,7 +108,7 @@ The **KPIs** section summarizes the most important metrics of your test suite:
</p>

<p align="center">
<img src="./static/keyword_usage.png" alt="graph_view" width="900"/>
<img src="./resources/keyword_usage.png" alt="graph_view" width="900"/>
</p>

<br>
Expand Down Expand Up @@ -165,7 +165,7 @@ The **Robocop** view integrates the `https://robocop.readthedocs.io/` linter dir


<p align="center">
<img src="./static/robocop.png" alt="robocop_issues" width="900"/>
<img src="./resources/robocop.png" alt="robocop_issues" width="900"/>
</p>


Expand Down
24 changes: 12 additions & 12 deletions vscode-integration/out/extension.js

Large diffs are not rendered by default.

Binary file modified vscode-integration/roboview-0.0.1.vsix
Binary file not shown.
76 changes: 43 additions & 33 deletions vscode-integration/src/services/backendConnectionManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,31 +62,7 @@ export class BackendConnectionManager {
this.serverOutputChannel.appendLine(
`Working Directory: ${workspaceFolder}`,
);
this.serverOutputChannel.appendLine("─".repeat(50));

this.serverOutputChannel.appendLine(
"Checking if RoboView is installed...",
);
const checkProcess = spawnSync(
pythonInterpreterPath,
["-m", "pip", "show", "roboview"],
{
cwd: workspaceFolder,
encoding: "utf8",
},
);

if (
checkProcess.status !== 0 ||
!checkProcess.stdout.includes("Name: roboview")
) {
const errorMsg =
"RoboView is not installed. Please install it using: pip install roboview";
vscode.window.showErrorMessage(errorMsg);
return false;
}

this.serverOutputChannel.appendLine("✓ RoboView is installed");
this.serverOutputChannel.appendLine("Starting RoboView Server...");
this.serverOutputChannel.appendLine("─".repeat(50));

this.serverProcess = spawn(
Expand All @@ -108,29 +84,63 @@ export class BackendConnectionManager {

this.serverProcess.stderr?.on("data", (data) => {
const error = data.toString();
this.serverOutputChannel.appendLine(`${error}`);
this.serverOutputChannel.appendLine(error);
});

this.serverProcess.on("close", (code) => {
const message = `Backend process exited with code ${code}`;
this.serverOutputChannel.appendLine(`${message}`);
this.serverOutputChannel.appendLine(message);
vscode.window.showInformationMessage(message);
});

this.serverProcess.on("error", (error) => {
const message = `Failed to start backend: ${error.message}`;
this.serverOutputChannel.appendLine(`[ERROR] ${message}`);
vscode.window.showErrorMessage(message);
});
const started = await this.checkServerProcessAlive();

if (!started) {
this.killServerProcess();
return false;
}

return true;
} catch (error) {
const message = `Error starting backend: ${error}`;
const message = `Error starting backend: ${error}. Please ensure that roboview is installed in the current Python environment.`;
this.serverOutputChannel.appendLine(`[ERROR] ${message}`);
vscode.window.showErrorMessage(message);
return false;
}
}

private checkServerProcessAlive(
timeoutMs: number = 120000,
intervalMs: number = 1000,
): Promise<boolean> {
return new Promise((resolve) => {
const startTime = Date.now();

const onError = () => resolve(false);
const onClose = () => resolve(false);

this.serverProcess?.on("error", onError);
this.serverProcess?.on("close", onClose);

const interval = setInterval(async () => {
if (Date.now() - startTime > timeoutMs) {
clearInterval(interval);
this.serverProcess?.removeListener("error", onError);
this.serverProcess?.removeListener("close", onClose);
resolve(false);
return;
}

if (await this.isServerRunning()) {
clearInterval(interval);
this.serverProcess?.removeListener("error", onError);
this.serverProcess?.removeListener("close", onClose);
resolve(true);
}
}, intervalMs);
});
}

public async initializeServer(
currentPanel: vscode.WebviewPanel | undefined,
): Promise<void> {
Expand Down