Skip to content

Commit c4783da

Browse files
committed
update
1 parent 76f9a28 commit c4783da

11 files changed

+89
-14
lines changed

CHANGELOG.md

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

33
---
44

5+
## [v0.0.17](https://github.com/phil1436/ownobjectscriptextension/tree/0.0.17) (2023-?-?)
6+
7+
- Bug fixes
8+
- Category `Own ObjectScript Comment` renamed to `Own ObjectScript Documentation`
9+
10+
---
11+
512
## [v0.0.16](https://github.com/phil1436/ownobjectscriptextension/tree/0.0.16) (2023-6-15)
613

714
- Refactoring

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ This extension will create a directory named _ownobjectscriptextension-workspace
139139

140140
> Tip: Lines starting with a keyword will be ignored by the command `Add ObjectScript Modifier`.
141141
142-
### Own ObjectScript Comment
142+
### Own ObjectScript Documentation
143143

144144
- `Add Method Description`: Adds a description template to your `Method` or `ClassMethod`. See [here](#add-method-description) for more information.
145145
- `Edit Method Description Template`: Opens the _MethodDescriptionTemplate.json_ file so you can edit the method template. Reload Window after editing!

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"author": "Philipp B.",
66
"publisher": "PhilippB",
77
"license": "MIT",
8-
"version": "0.0.16",
8+
"version": "0.0.17",
99
"repository": {
1010
"type": "github",
1111
"url": "https://github.com/phil1436/ownobjectscriptextension"
@@ -18,10 +18,8 @@
1818
"Formatters"
1919
],
2020
"keywords": [
21-
"IntelliSense",
2221
"intersystems",
23-
"objectscript",
24-
"multi-root ready"
22+
"objectscript"
2523
],
2624
"activationEvents": [
2725
"onCommand:ownobjectscriptextension.addObjectScriptModifier",
@@ -33,7 +31,7 @@
3331
"onCommand:ownobjectscriptextension.makeSelectStatement",
3432
"onCommand:ownobjectscriptextension.translateEmbPython",
3533
"onCommand:ownobjectscriptextension.editMethodDescriptionTemplate",
36-
"ownobjectscriptextension.createNewClass"
34+
"onCommand:ownobjectscriptextension.createNewClass"
3735
],
3836
"main": "./src/extension.js",
3937
"contributes": {
@@ -61,17 +59,17 @@
6159
{
6260
"command": "ownobjectscriptextension.addMethodDescriptionTemplate",
6361
"title": "Add Method Description",
64-
"category": "Own ObjectScript Comment"
62+
"category": "Own ObjectScript Documentation"
6563
},
6664
{
6765
"command": "ownobjectscriptextension.editMethodDescriptionTemplate",
6866
"title": "Edit Method Description Template",
69-
"category": "Own ObjectScript Comment"
67+
"category": "Own ObjectScript Documentation"
7068
},
7169
{
7270
"command": "ownobjectscriptextension.addInlineComments",
7371
"title": "Add Inline Comments",
74-
"category": "Own ObjectScript Comment"
72+
"category": "Own ObjectScript Documentation"
7573
},
7674
{
7775
"command": "ownobjectscriptextension.makeSelectStatement",

src/commands/Create.js

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,42 @@
11
const vscode = require('vscode');
22
const wizard = require('../wizard');
33
const { TextEncoder } = require('util');
4+
const path = require('path');
5+
const fs = require('fs');
6+
7+
/* async function createPanel() {
8+
const panel = vscode.window.createWebviewPanel(
9+
'create New Wizard',
10+
'Create New Wizard 🔮',
11+
{ viewColumn: vscode.ViewColumn.One, preserveFocus: false }
12+
);
13+
panel.webview.html = fs.readFileSync(
14+
path.join(__dirname, '..', 'webview', 'index.html'),
15+
'utf8'
16+
);
17+
18+
return panel;
19+
} */
420

521
async function createNewClass() {
622
//Get workspace folder
723
if (vscode.workspace.workspaceFolders.length == 0) {
824
vscode.window.showErrorMessage('Open a folder in your workspace!');
925
return;
1026
}
27+
/* console.log(
28+
vscode.workspace
29+
.getConfiguration('ownobjectscriptextension.create')
30+
.get('UseWebview')
31+
);
32+
if (
33+
vscode.workspace
34+
.getConfiguration('ownobjectscriptextension.create')
35+
.get('UseWebview')
36+
) {
37+
createPanel();
38+
return;
39+
} */
1140
let workspacefolderUri = undefined;
1241
if (vscode.workspace.workspaceFolders.length > 1) {
1342
let wsfList = [];
@@ -130,6 +159,28 @@ async function createNewClass() {
130159

131160
let doc = await vscode.workspace.openTextDocument(fileUri); // calls back into the provider
132161
await vscode.window.showTextDocument(doc, { preview: false });
162+
await vscode.window.activeTextEditor.edit(function (editBuilder) {
163+
// delete everything in the document
164+
let start = new vscode.Position(0, 0);
165+
let lastLine = vscode.window.activeTextEditor.document.lineAt(
166+
vscode.window.activeTextEditor.document.lineCount - 1
167+
);
168+
let end = new vscode.Position(
169+
vscode.window.activeTextEditor.document.lineCount - 1,
170+
lastLine.text.length
171+
);
172+
let range = new vscode.Range(start, end);
173+
editBuilder.delete(range);
174+
// write text to document
175+
editBuilder.insert(new vscode.Position(0, 0), text);
176+
});
177+
//Save if option is turned on
178+
if (
179+
vscode.workspace
180+
.getConfiguration('ownobjectscriptextension')
181+
.get('SaveFile')
182+
)
183+
vscode.window.activeTextEditor.document.save();
133184
}
134185

135186
module.exports = {
File renamed without changes.

src/extension.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
const vscode = require('vscode');
22

33
const Modifier = require('./commands/Modifier');
4-
const Comment = require('./commands/Comment');
4+
const Comment = require('./commands/Documentation');
55
const SQL = require('./commands/SQL');
66
const Translate = require('./commands/Translate');
77
const Create = require('./commands/Create');

src/webview/index.html

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
6+
<title>Create New Wizard</title>
7+
</head>
8+
<body>
9+
<!-- <script src="./main.js" type="module"></script>
10+
-->
11+
<script>
12+
function changeColor() {
13+
document.getElementById('heading').style.color = 'green';
14+
}
15+
</script>
16+
<div align="center">
17+
<h1 style="color: red" id="heading">Create New Wizard🔮</h1>
18+
</div>
19+
<button onclick="changeColor()">Change color</button>
20+
</body>
21+
</html>

src/webview/main.js

Whitespace-only changes.

src/webview/style.css

Whitespace-only changes.

src/wizard.js

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,6 @@ async function createBusinessService(
7575
className,
7676
addTargetConfigNames
7777
) {
78-
// TODO add types of method parameters dependend of the adapter
7978
const inboundAdapterSuggestion = [
8079
{
8180
name: 'None',
@@ -298,7 +297,6 @@ async function createBusinessService(
298297
*/
299298
async function createBusinessOperation(packageName, className) {
300299
//Adapter
301-
302300
const outboundAdapterSuggestion = [
303301
{
304302
name: 'None',

0 commit comments

Comments
 (0)