Skip to content

Commit c5ac704

Browse files
authored
Add commands for creating new files (#1029)
1 parent 819b777 commit c5ac704

File tree

6 files changed

+886
-0
lines changed

6 files changed

+886
-0
lines changed

.vscode/settings.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
{
22
"[typescript]": {
33
"editor.defaultFormatter": "esbenp.prettier-vscode",
4+
"editor.tabSize": 2,
45
"editor.formatOnSave": true
56
},
67
}

docs/Studio.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,7 @@ After loading the snippets it is recommended that you consider opening the gener
4343
## Load Studio Syntax Colors Command
4444

4545
The [InterSystems ObjectScript extension](https://marketplace.visualstudio.com/items?itemName=intersystems-community.vscode-objectscript) provides the `Load Studio Syntax Colors` command, which will load the editor background and syntax foreground colors from Studio into VS Code. It works by reading the color configurations from the Windows registry and storing them in VS Code's [User Settings](https://code.visualstudio.com/docs/getstarted/settings) as customizations of one of the InterSystems default themes provided by the Language Server extension. The command uses the background color loaded from Studio to determine which default theme it should modify, and will activate the modified theme automatically. This command will not load foreground colors for any syntax tokens that have a custom background color because per-token background colors are not supported in VS Code. This command requires that the [InterSystems Language Server extension](https://marketplace.visualstudio.com/items?itemName=intersystems.language-server) is installed and active. To invoke the command, [open the command palette](https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette) and click the `ObjectScript: Load Studio Syntax Colors` option.
46+
47+
## New File Commands
48+
49+
The [InterSystems ObjectScript extension](https://marketplace.visualstudio.com/items?itemName=intersystems-community.vscode-objectscript) provides commands for creating new Interoperability classes. Commands are provided for Business Operation, Business Process, Business Rule, Business Service and Data Transformation classes. These commands are modeled after the wizards in Studio's [`File` → `New...` → `Production` menu](https://docs.intersystems.com/irislatest/csp/docbook/DocBook.UI.Page.cls?KEY=GSTD_Commands#GSTD_Commands_File). The commands are shown in the `New File...` menu, which can be opened from the `File` menu (`File` → `New File...`) or the `Get Started` welcome page.

package.json

Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,11 @@
8181
"onCommand:vscode-objectscript.removeItemsFromProject",
8282
"onCommand:vscode-objectscript.loadStudioSnippets",
8383
"onCommand:vscode-objectscript.loadStudioColors",
84+
"onCommand:vscode-objectscript.newFile.businessOperation",
85+
"onCommand:vscode-objectscript.newFile.bpl",
86+
"onCommand:vscode-objectscript.newFile.rule",
87+
"onCommand:vscode-objectscript.newFile.businessService",
88+
"onCommand:vscode-objectscript.newFile.dtl",
8489
"onLanguage:objectscript",
8590
"onLanguage:objectscript-int",
8691
"onLanguage:objectscript-class",
@@ -294,6 +299,26 @@
294299
{
295300
"command": "vscode-objectscript.loadStudioColors",
296301
"when": "isWindows"
302+
},
303+
{
304+
"command": "vscode-objectscript.newFile.businessOperation",
305+
"when": "false"
306+
},
307+
{
308+
"command": "vscode-objectscript.newFile.bpl",
309+
"when": "false"
310+
},
311+
{
312+
"command": "vscode-objectscript.newFile.rule",
313+
"when": "false"
314+
},
315+
{
316+
"command": "vscode-objectscript.newFile.businessService",
317+
"when": "false"
318+
},
319+
{
320+
"command": "vscode-objectscript.newFile.dtl",
321+
"when": "false"
297322
}
298323
],
299324
"view/title": [
@@ -539,6 +564,33 @@
539564
"when": "vscode-objectscript.connectActive && resourceScheme =~ /^isfs(-readonly)?$/ && resource =~ /project%3D/ && explorerResourceIsRoot",
540565
"group": "objectscript_prj@2"
541566
}
567+
],
568+
"file/newFile": [
569+
{
570+
"command": "vscode-objectscript.newFile.businessOperation",
571+
"when": "workspaceFolderCount != 0",
572+
"group": "file"
573+
},
574+
{
575+
"command": "vscode-objectscript.newFile.bpl",
576+
"when": "workspaceFolderCount != 0",
577+
"group": "file"
578+
},
579+
{
580+
"command": "vscode-objectscript.newFile.rule",
581+
"when": "workspaceFolderCount != 0",
582+
"group": "file"
583+
},
584+
{
585+
"command": "vscode-objectscript.newFile.businessService",
586+
"when": "workspaceFolderCount != 0",
587+
"group": "file"
588+
},
589+
{
590+
"command": "vscode-objectscript.newFile.dtl",
591+
"when": "workspaceFolderCount != 0",
592+
"group": "file"
593+
}
542594
]
543595
},
544596
"languages": [
@@ -973,6 +1025,31 @@
9731025
"category": "ObjectScript",
9741026
"command": "vscode-objectscript.loadStudioColors",
9751027
"title": "Load Studio Syntax Colors"
1028+
},
1029+
{
1030+
"category": "ObjectScript",
1031+
"command": "vscode-objectscript.newFile.businessOperation",
1032+
"title": "Business Operation"
1033+
},
1034+
{
1035+
"category": "ObjectScript",
1036+
"command": "vscode-objectscript.newFile.bpl",
1037+
"title": "Business Process"
1038+
},
1039+
{
1040+
"category": "ObjectScript",
1041+
"command": "vscode-objectscript.newFile.rule",
1042+
"title": "Business Rule"
1043+
},
1044+
{
1045+
"category": "ObjectScript",
1046+
"command": "vscode-objectscript.newFile.businessService",
1047+
"title": "Business Service"
1048+
},
1049+
{
1050+
"category": "ObjectScript",
1051+
"command": "vscode-objectscript.newFile.dtl",
1052+
"title": "Data Transformation"
9761053
}
9771054
],
9781055
"keybindings": [

src/api/index.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -705,4 +705,14 @@ export class AtelierAPI {
705705
return this.getAsyncResult(id, 50, token);
706706
});
707707
}
708+
709+
// v1+
710+
public async getNamespace(nsOverride?: string): Promise<Atelier.Response> {
711+
return this.request(1, "GET", nsOverride || this.ns);
712+
}
713+
714+
// v1+
715+
public async getEnsClassList(type: number): Promise<Atelier.Response> {
716+
return this.request(1, "GET", `${this.ns}/ens/classes/${type}`);
717+
}
708718
}

0 commit comments

Comments
 (0)