-
Notifications
You must be signed in to change notification settings - Fork 1
Testclassinclude #18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Testclassinclude #18
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,7 +12,7 @@ async function createFile(path: string, filename: string, content: string) { | |
| } | ||
| const uintarray = new TextEncoder().encode(content); | ||
| await vscode.workspace.fs.writeFile(uri, uintarray); | ||
| await vscode.window.showTextDocument(uri, {preview: false}); | ||
| await vscode.window.showTextDocument(uri, { preview: false }); | ||
| } | ||
|
|
||
| async function findFolder(uri: vscode.Uri): Promise<string> { | ||
|
|
@@ -39,11 +39,11 @@ async function fileExists(uri: vscode.Uri): Promise<boolean> { | |
|
|
||
| export async function createArtifact(uri: vscode.Uri) { | ||
| if (uri === undefined) { | ||
| vscode.window.showErrorMessage('Right click folder in explorer view', {modal: true}); | ||
| vscode.window.showErrorMessage('Right click folder in explorer view', { modal: true }); | ||
| return; | ||
| } | ||
|
|
||
| const foo: {[name: string]: (uri: vscode.Uri) => Promise<void>} = { | ||
| const foo: { [name: string]: (uri: vscode.Uri) => Promise<void> } = { | ||
| "CLAS - Class (abapGit)": createCLAS, | ||
| "INTF - Interface (abapGit)": createINTF, | ||
| "PROG - Program (abapGit)": createPROG, | ||
|
|
@@ -70,7 +70,7 @@ export async function createArtifact(uri: vscode.Uri) { | |
|
|
||
| function createAff(key: string) { | ||
| const ret = async (uri: vscode.Uri) => { | ||
| let name = await vscode.window.showInputBox({placeHolder: "name"}); | ||
| let name = await vscode.window.showInputBox({ placeHolder: "name" }); | ||
| if (name === undefined || name === "") { | ||
| return; | ||
| } | ||
|
|
@@ -106,7 +106,7 @@ function createAff(key: string) { | |
| } | ||
|
|
||
| async function createCLAS(uri: vscode.Uri) { | ||
| const name = await vscode.window.showInputBox({placeHolder: "cl_name"}); | ||
| const name = await vscode.window.showInputBox({ placeHolder: "cl_name" }); | ||
| if (name === undefined || name === "") { | ||
| return; | ||
| } | ||
|
|
@@ -142,10 +142,22 @@ CLASS ${name.toLowerCase()} IMPLEMENTATION. | |
|
|
||
| ENDCLASS.`; | ||
| await createFile(dir, uriABAP, dataABAP); | ||
|
|
||
| const createTestClass = await vscode.window.showQuickPick( | ||
| [{ label: "yes" }, | ||
| { label: "no" }], | ||
|
Comment on lines
144
to
+148
|
||
| { placeHolder: "Add test class include?" } | ||
| ); | ||
|
|
||
| if (createTestClass?.label === "yes") { | ||
| const uriTestIncl = filename + ".testclasses" + ".abap"; | ||
| const dataTestIncl = `*"* use this source file for your ABAP unit test classes`; | ||
| await createFile(dir, uriTestIncl, dataTestIncl); | ||
MagPasulke marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } | ||
| } | ||
|
|
||
| async function createINTF(uri: vscode.Uri) { | ||
| const name = await vscode.window.showInputBox({placeHolder: "if_name"}); | ||
| const name = await vscode.window.showInputBox({ placeHolder: "if_name" }); | ||
| if (name === undefined || name === "") { | ||
| return; | ||
| } | ||
|
|
@@ -179,7 +191,7 @@ ENDINTERFACE.`; | |
| } | ||
|
|
||
| async function createPROG(uri: vscode.Uri) { | ||
| const name = await vscode.window.showInputBox({placeHolder: "zreport"}); | ||
| const name = await vscode.window.showInputBox({ placeHolder: "zreport" }); | ||
| if (name === undefined || name === "") { | ||
| return; | ||
| } | ||
|
|
@@ -210,11 +222,11 @@ async function createPROG(uri: vscode.Uri) { | |
| } | ||
|
|
||
| async function createFUGR(uri: vscode.Uri) { | ||
| const groupName = await vscode.window.showInputBox({placeHolder: "z_fugr"}); | ||
| const groupName = await vscode.window.showInputBox({ placeHolder: "z_fugr" }); | ||
| if (groupName === undefined || groupName === "") { | ||
| return; | ||
| } | ||
| const moduleName = await vscode.window.showInputBox({placeHolder: "zfunction_module"}); | ||
| const moduleName = await vscode.window.showInputBox({ placeHolder: "zfunction_module" }); | ||
| if (moduleName === undefined || moduleName === "") { | ||
| return; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.