Skip to content

Commit c48e8b3

Browse files
authored
Merge branch 'master' into CSPandOtherFiles
2 parents ecf8b4c + 760c290 commit c48e8b3

File tree

8 files changed

+200
-82
lines changed

8 files changed

+200
-82
lines changed

.vscode/launch.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@
1414
"stopOnEntry": false,
1515
"sourceMaps": true,
1616
"outFiles": [
17-
"${workspaceRoot}/out/**/*.js"
17+
"${workspaceRoot}/dist/**/*.js"
1818
],
19-
"preLaunchTask": "npm: watch"
19+
"preLaunchTask": "npm: webpack"
2020
},
2121
{
2222
"name": "Launch Extension",
@@ -29,9 +29,9 @@
2929
"stopOnEntry": false,
3030
"sourceMaps": true,
3131
"outFiles": [
32-
"${workspaceRoot}/out/**/*.js"
32+
"${workspaceRoot}/dist/**/*.js"
3333
],
34-
"preLaunchTask": "npm: watch"
34+
"preLaunchTask": "npm: webpack"
3535
},
3636
{
3737
"name": "Extension Tests",

package.json

Lines changed: 74 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -128,8 +128,20 @@
128128
"when": "false"
129129
},
130130
{
131-
"command": "vscode-objectscript.studio.actions",
132-
"when": "vscode-objectscript.connectActive && resourceScheme == isfs"
131+
"command": "vscode-objectscript.serverCommands.sourceControl",
132+
"when": "vscode-objectscript.connectActive && resourceScheme == isfs || vscode-objectscript.connectActive && !editorIsOpen"
133+
},
134+
{
135+
"command": "vscode-objectscript.serverCommands.contextSourceControl",
136+
"when": "false"
137+
},
138+
{
139+
"command": "vscode-objectscript.serverCommands.other",
140+
"when": "vscode-objectscript.connectActive && resourceScheme == isfs || vscode-objectscript.connectActive && !editorIsOpen"
141+
},
142+
{
143+
"command": "vscode-objectscript.serverCommands.contextOther",
144+
"when": "false"
133145
}
134146
],
135147
"view/title": [
@@ -157,7 +169,11 @@
157169
"when": "view == ObjectScriptExplorer && viewItem =~ /^dataNode:/"
158170
},
159171
{
160-
"command": "vscode-objectscript.studio.contextActions",
172+
"command": "vscode-objectscript.serverCommands.contextSourceControl",
173+
"when": "view == ObjectScriptExplorer && viewItem =~ /^dataNode:/"
174+
},
175+
{
176+
"command": "vscode-objectscript.serverCommands.contextOther",
161177
"when": "view == ObjectScriptExplorer && viewItem =~ /^dataNode:/"
162178
},
163179
{
@@ -182,21 +198,46 @@
182198
"editor/context": [
183199
{
184200
"command": "vscode-objectscript.viewOthers",
185-
"when": "editorLangId =~ /^objectscript/ && vscode-objectscript.connectActive"
201+
"when": "editorLangId =~ /^objectscript/ && vscode-objectscript.connectActive",
202+
"group": "objectscript@1"
186203
},
187204
{
188205
"command": "vscode-objectscript.compile",
189-
"when": "editorLangId =~ /^objectscript/ && vscode-objectscript.connectActive"
206+
"when": "editorLangId =~ /^objectscript/ && vscode-objectscript.connectActive",
207+
"group": "objectscript@2"
190208
},
191209
{
192210
"command": "vscode-objectscript.studio.actions",
193211
"when": "resourceScheme == isfs && vscode-objectscript.connectActive"
194212
},
195-
{
196213
"command": "vscode-objectscript.previewXml",
197-
"when": "editorLangId =~ /^xml/"
214+
"when": "editorLangId =~ /^xml/",
215+
"group": "objectscript@3"
216+
},
217+
{
218+
"command": "vscode-objectscript.serverCommands.contextSourceControl",
219+
"when": "resourceScheme == isfs && editorLangId =~ /^objectscript/ && vscode-objectscript.connectActive",
220+
"group": "objectscript@4"
221+
},
222+
{
223+
"command": "vscode-objectscript.serverCommands.contextOther",
224+
"when": "resourceScheme == isfs && editorLangId =~ /^objectscript/ && vscode-objectscript.connectActive",
225+
"group": "objectscript@5"
198226
}
199227
],
228+
"editor/title": [
229+
{
230+
"command": "vscode-objectscript.serverCommands.sourceControl",
231+
"group": "navigation@1",
232+
"when": "vscode-objectscript.connectActive && resourceScheme == isfs"
233+
},
234+
{
235+
"command": "vscode-objectscript.serverCommands.other",
236+
"group": "navigation@2",
237+
"when": "vscode-objectscript.connectActive && resourceScheme == isfs"
238+
}
239+
240+
],
200241
"touchBar": [
201242
{
202243
"command": "vscode-objectscript.touchBar.compile",
@@ -212,11 +253,18 @@
212253
"explorer/context": [
213254
{
214255
"command": "vscode-objectscript.compileFolder",
215-
"when": "vscode-objectscript.connectActive"
256+
"when": "vscode-objectscript.connectActive",
257+
"group": "objectscript@1"
216258
},
217259
{
218-
"command": "vscode-objectscript.studio.actions",
219-
"when": "resourceScheme == isfs && resourceLangId =~ /^objectscript/ && vscode-objectscript.connectActive"
260+
"command": "vscode-objectscript.serverCommands.contextSourceControl",
261+
"when": "resourceScheme == isfs && resourceLangId =~ /^objectscript/ && vscode-objectscript.connectActive",
262+
"group": "objectscript@2"
263+
},
264+
{
265+
"command": "vscode-objectscript.serverCommands.contextOther",
266+
"when": "resourceScheme == isfs && resourceLangId =~ /^objectscript/ && vscode-objectscript.connectActive",
267+
"group": "objectscript@3"
220268
}
221269
]
222270
},
@@ -409,13 +457,25 @@
409457
},
410458
{
411459
"category": "ObjectScript",
412-
"command": "vscode-objectscript.studio.actions",
413-
"title": "Studio Actions..."
460+
"command": "vscode-objectscript.serverCommands.sourceControl",
461+
"title": "Server Source Control...",
462+
"icon": "$(source-control)"
463+
},
464+
{
465+
"category": "ObjectScript",
466+
"command": "vscode-objectscript.serverCommands.contextSourceControl",
467+
"title": "Server Source Control..."
468+
},
469+
{
470+
"category": "ObjectScript",
471+
"command": "vscode-objectscript.serverCommands.other",
472+
"title": "Server Command Menu...",
473+
"icon": "$(server-environment)"
414474
},
415475
{
416476
"category": "ObjectScript",
417-
"command": "vscode-objectscript.studio.contextActions",
418-
"title": "Studio Context Actions..."
477+
"command": "vscode-objectscript.serverCommands.contextOther",
478+
"title": "Server Command Menu..."
419479
}
420480
],
421481
"keybindings": [

src/api/index.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -210,9 +210,6 @@ export class AtelierAPI {
210210
if (data.result.status && data.result.status !== "") {
211211
const status: string = data.result.status;
212212
outputChannel.appendLine(status);
213-
if (status.endsWith("is marked as read only by source control hooks.")) {
214-
vscode.window.showWarningMessage(status, { modal: true });
215-
}
216213
throw new Error(data.result.status);
217214
}
218215
if (data.status.summary) {

src/commands/compile.ts

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,16 @@ async function compileFlags(): Promise<string> {
2121

2222
async function importFile(file: CurrentFile): Promise<any> {
2323
const api = new AtelierAPI(file.uri);
24-
return api.putDoc(
25-
file.name,
26-
{
27-
content: file.content.split(/\r?\n/),
28-
enc: false,
29-
},
30-
true
31-
);
24+
return api
25+
.putDoc(
26+
file.name,
27+
{
28+
content: file.content.split(/\r?\n/),
29+
enc: false,
30+
},
31+
true
32+
)
33+
.catch((error) => vscode.window.showErrorMessage(error.message));
3234
}
3335

3436
function updateOthers(others: string[]) {

src/commands/serverActions.ts

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import * as vscode from "vscode";
2-
import { config, workspaceState, checkConnection } from "../extension";
2+
import { config, workspaceState, checkConnection, FILESYSTEM_SCHEMA } from "../extension";
33
import { currentWorkspaceFolder, terminalWithDocker, currentFile } from "../utils";
4+
import { mainCommandMenu, mainSourceControlMenu } from "./studio";
45

56
export async function serverActions(): Promise<void> {
67
const { active, host, ns, https, port: defaultPort, username, password: defaultPassword, links } = config("conn");
@@ -45,34 +46,48 @@ export async function serverActions(): Promise<void> {
4546
detail: "Use docker-compose to start session inside configured service",
4647
});
4748
}
49+
const studio = [];
50+
if (!vscode.window.activeTextEditor || vscode.window.activeTextEditor.document.uri.scheme === FILESYSTEM_SCHEMA) {
51+
studio.push({
52+
id: "serverSourceControlMenu",
53+
label: "Server Source Control...",
54+
detail: "Pick server-side source control action",
55+
});
56+
studio.push({
57+
id: "serverCommandMenu",
58+
label: "Server Command Menu...",
59+
detail: "Pick server-side command",
60+
});
61+
}
4862
return vscode.window
4963
.showQuickPick(
5064
[
5165
...extraLinks,
5266
{
5367
id: "refreshConnection",
54-
label: "Refresh connection",
68+
label: "Refresh Connection",
5569
detail: "Force attempt to connect to the server",
5670
},
5771
...terminal,
5872
{
59-
detail: "Enable/Disable current connection",
6073
id: "toggleConnection",
61-
label: "Toggle connection",
74+
label: "Toggle Connection",
75+
detail: "Enable/Disable current connection",
6276
},
6377
{
64-
detail: portalUrl,
6578
id: "openPortal",
6679
label: "Open Management Portal",
80+
detail: portalUrl,
6781
},
6882
{
69-
detail: classRef,
7083
id: "openClassReference",
71-
label: "Open class reference",
84+
label: "Open Class Reference",
85+
detail: classRef,
7286
},
87+
...studio,
7388
],
7489
{
75-
placeHolder: `Select action for server: ${connInfo}`,
90+
placeHolder: `Select action for server ${connInfo}`,
7691
}
7792
)
7893
.then((action) => {
@@ -99,6 +114,14 @@ export async function serverActions(): Promise<void> {
99114
terminalWithDocker();
100115
break;
101116
}
117+
case "serverSourceControlMenu": {
118+
mainSourceControlMenu();
119+
break;
120+
}
121+
case "serverCommandMenu": {
122+
mainCommandMenu();
123+
break;
124+
}
102125
default: {
103126
vscode.env.openExternal(vscode.Uri.parse(action.detail));
104127
}

0 commit comments

Comments
 (0)