Skip to content

Commit 920a8f6

Browse files
committed
#284 Optimization of VC UTBot Quickstart wizard
- fix `isRemoteScenario` for local-remote scenario (remote root != project path)
1 parent ed609bf commit 920a8f6

File tree

3 files changed

+13
-12
lines changed

3 files changed

+13
-12
lines changed

vscode-plugin/media/wizard.html

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -77,19 +77,19 @@ <h2>👋 Welcome to "UTBot: Quickstart" Wizard! </h2>
7777
</div>
7878

7979
<div class="utbot-form__tab connection-tab" vs-message-callback="sendServerSetup()">
80-
<h2>🖥️ Server Setup</h2>
80+
<h2>🖥️ Server Setup</h2>
8181
<div id="useLocalHostSetup">
82-
<input type="checkbox" id="useLocalHost" onclick="setupLocalHost();">
82+
<input type="checkbox" id="useLocalHost" onclick="handleOnOffDefaultConfigurationOnLocalhost();">
8383
<label for="useLocalHost">Default server configuration on <b><code>localhost</code></b> (or WSL2)</label>
8484
</div>
8585
<br>
8686

8787
<span style="display: grid; grid-template-columns: auto auto">
88-
<b>📶 Connection</b>
88+
<b>📶 Connection</b>
8989
<span>
9090
<span id="connection_loader">⏳ Connecting...</span>
91-
<span id="connection_success">️Successfully pinged server! </span>
92-
<span id="connection_warning" format="️Warning! Versions are different: "></span>
91+
<span id="connection_success">️ Successfully pinged server! </span>
92+
<span id="connection_warning" format="️ Warning! Versions are different: "></span>
9393
<span id="connection_failure">❌ Failed to establish connection! </span>
9494
</span>
9595
</span>
@@ -173,7 +173,7 @@ <h2>📑️ Project Setup</h2>
173173
</div>
174174

175175
<div class="utbot-form__tab">
176-
<div><b>🎉Success!</b></div>
176+
<div><b>🎉 Success!</b></div>
177177
<div>
178178
UTBot extension was successfully configured, and now you are ready to use all its functionality.<br>
179179
If you want to learn more about UTBot C/C++ or you have ay questions related to its usage, please,

vscode-plugin/media/wizard.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ function $(id) {
3030
*/
3131
const vscode = acquireVsCodeApi();
3232
function DbgMessage(message) {
33-
// vscode.postMessage({
34-
// command: 'dbg_message',
35-
// message: message
36-
// });
33+
vscode.postMessage({
34+
command: 'dbg_message',
35+
message: message
36+
});
3737
}
3838

3939
const os = getVarValue("os");
@@ -288,7 +288,7 @@ function removeElementByClassName(className) {
288288
}
289289
}
290290

291-
function setupLocalHost() {
291+
function handleOnOffDefaultConfigurationOnLocalhost() {
292292
const mappingInput = $('mappingInput');
293293
const hostInput = $('hostInput');
294294
const portInput = $('portInput');

vscode-plugin/src/config/prefs.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ export class Prefs {
4949
}
5050

5151
public static isRemoteScenario(): boolean {
52-
return !this.isLocalHost() || isWin32();
52+
return !(this.isLocalHost() && this.getRemotePath() === vsUtils.getProjectDirByOpenedFile().fsPath)
53+
|| isWin32();
5354
}
5455

5556
/**

0 commit comments

Comments
 (0)