Skip to content

Commit db9d0d1

Browse files
committed
#1 #3 #4 - Add comments to functions
1 parent a5882b2 commit db9d0d1

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

tooling/src/index.ts

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ import * as jsonforms from '@jsonforms/core';
44
import { writeFile, readFile } from 'fs';
55

66
/**
7+
* Clones a git repository and runs npm install on it
8+
* @param {string} repo the name of the repo that should be cloned
9+
* @param {string} path to the folder, where the repo should be cloned into
10+
* @param {function} callback forwards the current status to the caller
11+
*/
712
export function cloneAndInstall(repo: String, path: string, callback: (result: string, type?: string) => void) {
813
var url = '';
914
switch(repo) {
@@ -33,6 +38,10 @@ export function cloneAndInstall(repo: String, path: string, callback: (result: s
3338
}
3439

3540
/**
41+
* Generates the default UI Schema from a json schema
42+
* @param {string} path path to the json schema file
43+
* @param {function} callback forwards the current status to the caller
44+
*/
3645
export function generateUISchema(path: string, callback: (result: string, type?: string) => void) {
3746
readFile(path, 'utf8', (err, data) => {
3847
if (err) callback(err.message, 'err');
@@ -47,6 +56,11 @@ export function generateUISchema(path: string, callback: (result: string, type?:
4756
});
4857
}
4958

59+
/**
60+
* Takes a path and removes the last part
61+
* @param {string} path path to a folder or file
62+
* @return {string} the path without the last part
63+
*/
5064
function removeLastPathElement(path: string) {
5165
var newPath = path.split('\\');
5266
newPath.pop();

vscode-extension/src/extension.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,11 @@ export function activate(context: vscode.ExtensionContext) {
5555
context.subscriptions.push(generateUISchema);
5656
}
5757

58+
/**
59+
* Show Visual Studio Code Message
60+
* @param {string} message the message that should be displayed
61+
* @param {string} type the type of the message
62+
*/
5863
function showMessage(message: string, type?: string) {
5964
switch(type) {
6065
case 'err':

0 commit comments

Comments
 (0)