Skip to content

Commit d67b9b4

Browse files
v1.3.1 (#28)
* [[ live-server ]] Added setting to ignore connection errors if not running (#27) This patch adds a setting to ignore connection errors if LiveCode is not running. Within the server you can also return "ignored" to prevent VSCode from displaying any toast notifications. * Update package.json --------- Co-authored-by: Ruaridh Bell <107618943+livecoderuaridh@users.noreply.github.com>
1 parent 57889dc commit d67b9b4

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "livecodescript",
33
"description": "This extension adds several features to handle livecodescript files",
44
"displayName": "Livecode Language Support",
5-
"version": "1.3.0",
5+
"version": "1.3.1",
66
"author": "FerrusLogic",
77
"publisher": "Ferruslogic",
88
"license": "SEE LICENSE IN LICENSE.md",
@@ -99,6 +99,11 @@
9999
"default": "61373",
100100
"description": "Server Port for liveserver"
101101
},
102+
"livecodescript.server.ignoreConnectionErrors": {
103+
"type": "boolean",
104+
"default": false,
105+
"description": "Ignore Connection Errors if LiveCode is not opened"
106+
},
102107
"livecodescript.formatter.enable": {
103108
"type": "boolean",
104109
"default": true,

src/features/livecodescript/LCSsendToLiveCode.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export default class LivecodescriptSender {
66
private host: string;
77
private port: number;
88
private hideError: boolean = false;
9+
private ignoreConnectionErrors: boolean
910

1011
constructor() {
1112
this.loadConfiguration();
@@ -39,7 +40,7 @@ export default class LivecodescriptSender {
3940
this.send(query);
4041
}
4142
});
42-
} else {
43+
} else if (result !== "ignored") {
4344
vscode.window
4445
.showErrorMessage(
4546
`Error running command in LiveCode: ${result}`,
@@ -61,7 +62,7 @@ export default class LivecodescriptSender {
6162
socket.destroy();
6263
console.log(err);
6364
if (err.code === "ECONNREFUSED") {
64-
if (!this.hideError) {
65+
if (!this.hideError && !this.ignoreConnectionErrors) {
6566
vscode.window
6667
.showErrorMessage(
6768
"Could not connect to LiveCode. Make sure LiveCode is running and listening on the correct port",
@@ -106,5 +107,6 @@ export default class LivecodescriptSender {
106107
const section = vscode.workspace.getConfiguration("livecodescript");
107108
this.host = section.get("server.host", "localhost");
108109
this.port = section.get("server.port", 61373);
110+
this.ignoreConnectionErrors = section.get("server.ignoreConnectionErrors");
109111
}
110112
}

0 commit comments

Comments
 (0)