Skip to content

Commit fc9be1c

Browse files
committed
serverSide editing disabled by default
1 parent ccbaacc commit fc9be1c

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

package.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "vscode-objectscript",
33
"displayName": "InterSystems ObjectScript",
44
"description": "InterSystems ObjectScript language support for Visual Studio Code",
5-
"version": "0.7.12",
5+
"version": "0.7.13-SNAPSHOT",
66
"icon": "images/logo.png",
77
"categories": [
88
"Programming Languages",
@@ -534,6 +534,11 @@
534534
"default": false,
535535
"type": "boolean",
536536
"description": "Suppress popup messages about successful compile"
537+
},
538+
"objectscript.serverSideEditing": {
539+
"default": false,
540+
"type": "boolean",
541+
"description": "Allow to edit code directly on server"
537542
}
538543
}
539544
},

src/explorer/models/classesNode.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ export class ClassNode extends NodeBase {
1414
return {
1515
collapsibleState: vscode.TreeItemCollapsibleState.None,
1616
command: {
17-
arguments: [DocumentContentProvider.getUri(this.fullName, this.workspaceFolder, this.namespace, true)],
17+
arguments: [DocumentContentProvider.getUri(this.fullName, this.workspaceFolder, this.namespace)],
1818
command: "vscode-objectscript.explorer.openClass",
1919
title: "Open class",
2020
},

src/providers/DocumentContentProvider.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,10 @@ export class DocumentContentProvider implements vscode.TextDocumentContentProvid
2323
}
2424
}
2525

26-
public static getUri(name: string, workspaceFolder?: string, namespace?: string, vfs = true): vscode.Uri {
26+
public static getUri(name: string, workspaceFolder?: string, namespace?: string, vfs?: boolean): vscode.Uri {
27+
if (vfs === undefined) {
28+
vfs = config("serverSideEditing");
29+
}
2730
workspaceFolder = workspaceFolder && workspaceFolder !== "" ? workspaceFolder : currentWorkspaceFolder();
2831
const found = this.getAsFile(name, workspaceFolder);
2932
if (found) {
@@ -53,7 +56,10 @@ export class DocumentContentProvider implements vscode.TextDocumentContentProvid
5356
private onDidChangeEvent: vscode.EventEmitter<vscode.Uri> = new vscode.EventEmitter<vscode.Uri>();
5457

5558
public provideTextDocumentContent(uri: vscode.Uri, token: vscode.CancellationToken): vscode.ProviderResult<string> {
56-
const fileName = uri.path.split("/")[1];
59+
const fileName = uri.path
60+
.split("/")
61+
.slice(1)
62+
.join(".");
5763
const api = new AtelierAPI();
5864
const query = url.parse(decodeURIComponent(uri.toString()), true).query;
5965
if (query) {

0 commit comments

Comments
 (0)