Skip to content

Commit a4a9269

Browse files
committed
create new class added
1 parent 4cf07b2 commit a4a9269

File tree

5 files changed

+58
-13
lines changed

5 files changed

+58
-13
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
---
44

5+
## [v0.0.13](https://github.com/phil1436/ownobjectscriptextension/tree/0.0.13) (2023-5-3)
6+
7+
- Command `Create New Class` added
8+
9+
---
10+
511
## [v0.0.12](https://github.com/phil1436/ownobjectscriptextension/tree/0.0.12) (2023-2-23)
612

713
- Bug fixes

README.md

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,26 +7,36 @@ A [Visual Studio Code](https://code.visualstudio.com/) extension that supplies t
77
---
88

99
- [Features](#features)
10+
- [Create New Class](#create-new-class)
1011
- [Add ObjectScript Modifier](#add-objectscript-modifier)
1112
- [Add Method Description Template](#add-method-description-template)
1213
- [Make Select Statement](#make-select-statement)
13-
- [Translate Embedded Python](#translate-embedded-python-beta)
14+
- [Translate Embedded Python _BETA_](#translate-embedded-python-_beta_)
1415
- [Requirements](#requirements)
1516
- [Installation](#installation)
1617
- [Workspace](#workspace)
1718
- [Commands](#commands)
19+
- [Own ObjectScript Create](#own-objectscript-create)
1820
- [Own ObjectScript Modifier](#own-objectscript-modifier)
1921
- [Own ObjectScript Comment](#own-objectscript-comment)
2022
- [Own ObjectScript SQL](#own-objectscript-sql)
2123
- [Own ObjectScript Translate](#own-objectscript-translate)
2224
- [Configuration](#configuration)
25+
- [Sql](#sql)
26+
- [Comment](#comment)
2327
- [Bugs](#bugs)
2428
- [Release Notes](#release-notes)
2529

2630
---
2731

2832
## Features
2933

34+
### `Create New Class`
35+
36+
Creates a new ObjectScript Class, Message, Business Service or Business Operation similar to the InterSystems Studio Wizard. Just execute the command and follow the instructions.
37+
38+
![DemoCreateNewClass](resources/DemoCreateNewClass.gif)
39+
3040
### `Add ObjectScript Modifier`
3141

3242
This command automatically adds `Set`, `Do` and `Write` to your InterSystems ObjectScript code.
@@ -47,7 +57,7 @@ Generates description templates for your Methods. Just put your cursor in the Me
4757
4858
### `Make Select Statement`
4959

50-
Generates a \*SELECT \*\* statement based on the current opened file.
60+
Generates a _SELECT_ statement based on the current opened file.
5161

5262
![demoMakeSelectStatement](https://github.com/phil1436/ownobjectscriptextension/raw/master/resources/DemoMakeSelectStatement.gif)
5363

@@ -91,6 +101,10 @@ This extension will create a directory named _ownobjectscriptextension-workspace
91101

92102
## Commands
93103

104+
### Own ObjectScript Create
105+
106+
- `Create New Class`: Creates a new ObjectScript class. See [here](#create-new-class) for more information.
107+
94108
### Own ObjectScript Modifier
95109

96110
- `Add ObjectScript Modifier`: Adds `Set`, `Do` and `Write` modifier to your ObjectScript code. See [here](https://github.com/phil1436/ownobjectscriptextension#add-objectscript-modifier) for more information.
@@ -131,6 +145,10 @@ Go to `File > Preferences > Settings` and than navigate to `Extensions > OwnObje
131145

132146
- `In Line Comment Count`: Sets the line count between added comments for `Own ObjectScript Comment: Add Inline Comments` (Default: _5_).
133147

148+
### Create
149+
150+
- `Ask For Package First`: Set if the extension should ask for the package first (Default: _disabled_).
151+
134152
---
135153

136154
## Bugs
@@ -141,10 +159,9 @@ Go to `File > Preferences > Settings` and than navigate to `Extensions > OwnObje
141159

142160
## [Release Notes](https://github.com/phil1436/ownobjectscriptextension/blob/master/CHANGELOG.md)
143161

144-
### [v0.0.12](https://github.com/phil1436/ownobjectscriptextension/tree/0.0.12)
162+
### [v0.0.13](https://github.com/phil1436/ownobjectscriptextension/tree/0.0.13)
145163

146-
- Bug fixes
147-
- `Translate Embedded Python` will now generate a new method with the same name and the prefix _py_.
164+
- Command `Create New Class` added
148165

149166
---
150167

extension.js

Lines changed: 25 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -662,14 +662,31 @@ function activate(context) {
662662
);
663663
if (kind == undefined) return;
664664
// get class name and package
665-
let className = await vscode.window.showInputBox({
666-
placeHolder: 'Class Name',
667-
});
668-
if (className == undefined) return;
669-
let packageName = await vscode.window.showInputBox({
670-
placeHolder: 'Package',
671-
});
672-
if (packageName == undefined) return;
665+
let className = undefined;
666+
let packageName = undefined;
667+
if (
668+
vscode.workspace
669+
.getConfiguration('ownobjectscriptextension.create')
670+
.get('AskForPackageFirst')
671+
) {
672+
packageName = await vscode.window.showInputBox({
673+
placeHolder: 'Package',
674+
});
675+
if (packageName == undefined) return;
676+
className = await vscode.window.showInputBox({
677+
placeHolder: 'Class Name',
678+
});
679+
if (className == undefined) return;
680+
} else {
681+
className = await vscode.window.showInputBox({
682+
placeHolder: 'Class Name',
683+
});
684+
if (className == undefined) return;
685+
packageName = await vscode.window.showInputBox({
686+
placeHolder: 'Package',
687+
});
688+
if (packageName == undefined) return;
689+
}
673690

674691
let text = undefined;
675692

package.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,11 @@
107107
"default": false,
108108
"markdownDescription": "If enabled a .sql file will be generated after `Own ObjectScript SQL: Make Select Statement`."
109109
},
110+
"ownobjectscriptextension.create.AskForPackageFirst": {
111+
"type": "boolean",
112+
"default": false,
113+
"markdownDescription": "If enabled the command `Own ObjectScript Create: Create New Class` will first ask for the package name and then for the class name."
114+
},
110115
"ownobjectscriptextension.comment.InLineCommentCount": {
111116
"type": "number",
112117
"default": 5,

resources/DemoCreateNewClass.gif

10.5 MB
Loading

0 commit comments

Comments
 (0)