diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..fa53d17 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ + +type-script-helper-1.1.6.vsix +type-script-helper-1.1.7.vsix +type-script-helper-1.1.8.vsix diff --git a/type-script-helper-1.2.1.vsix b/type-script-helper-1.2.1.vsix new file mode 100644 index 0000000..9b9ed57 Binary files /dev/null and b/type-script-helper-1.2.1.vsix differ diff --git a/type-script-helper/package.json b/type-script-helper/package.json index fcd2390..67a856a 100644 --- a/type-script-helper/package.json +++ b/type-script-helper/package.json @@ -4,7 +4,7 @@ "description": "Helper for VS Code in TypeScript", "publisher": "IFX", "repository": "https://github.com/mikepharesjr/YO-VSCode/tree/master/type-script-helper", - "version": "1.2.0", + "version": "1.2.1", "engines": { "vscode": "^1.40.0" }, @@ -18,6 +18,7 @@ "onCommand:helper.convertToRegularExpression", "onCommand:helper.expandSql", "onCommand:helper.listToListFamily", + "onCommand:helper.listToListWrappedComma", "onCommand:helper.prettySql", "onCommand:helper.removeComment", "onCommand:helper.sortNormal", @@ -32,6 +33,7 @@ { "command": "helper.convertToRegularExpression", "title": "Convert to Regular Expression" }, { "command": "helper.expandSql", "title": "Expand Sql" }, { "command": "helper.listToListFamily", "title": "List to list family (Kristy, Mike ...)" }, + { "command": "helper.listToListWrappedComma", "title": "List to list wrapped comma" }, { "command": "helper.prettySql", "title": "Pretty Sql" }, { "command": "helper.removeComment", "title": "Remove comment" }, { "command": "helper.sortNormal", "title": "My Sort lines (ascending, case sensitive)" }, diff --git a/type-script-helper/src/extension.ts b/type-script-helper/src/extension.ts index 39bf076..5c37e5e 100644 --- a/type-script-helper/src/extension.ts +++ b/type-script-helper/src/extension.ts @@ -30,6 +30,7 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand('helper.convertToRegularExpression', helper.convertToRegularExpression), vscode.commands.registerCommand('helper.expandSql', helper.expandSql), vscode.commands.registerCommand('helper.listToListFamily', helper.listToListFamily), + vscode.commands.registerCommand('helper.listToListWrappedComma', helper.listToListWrappedComma), vscode.commands.registerCommand('helper.prettySql', helper.prettySql), vscode.commands.registerCommand('helper.removeComment', helper.removeComment), vscode.commands.registerCommand('helper.sortNormal', helper.sortNormal), diff --git a/type-script-helper/src/helper.ts b/type-script-helper/src/helper.ts index 5c07240..74e1252 100644 --- a/type-script-helper/src/helper.ts +++ b/type-script-helper/src/helper.ts @@ -10,6 +10,7 @@ enum LinesAction { convertToRegularExpression, expandSql, listToListFamily, + listToListWrappedComma, prettySql, removeComment, sortNormal, @@ -112,6 +113,12 @@ function listToListFamilyLogic(lines: string[]): void { } } +function listToListWrappedCommaLogic(lines: string[]): void { + for (let i = 0; i < lines.length; ++i) { + lines[i] = "'" + lines[i].trim() + "',"; + } +} + function prettySqlLogic(lines: string[]): void { for (let i = 0; i < lines.length; ++i) { lines[i] = ' ' + lines[i]; @@ -231,6 +238,7 @@ function linesFunction(linesAction: LinesAction): Thenable | undefined case LinesAction.convertToRegularExpression: { lines = convertToRegularExpressionLogic(lines); break; } case LinesAction.expandSql: { expandSqlLogic(lines); break; } case LinesAction.listToListFamily: { listToListFamilyLogic(lines); break; } + case LinesAction.listToListWrappedComma: { listToListWrappedCommaLogic(lines); break; } case LinesAction.prettySql: { prettySqlLogic(lines); break; } case LinesAction.removeComment: { removeCommentLogic(lines); break; } case LinesAction.sortNormal: { sortNormalLogic(lines); break; } @@ -247,6 +255,7 @@ export const addVBComment = () => linesFunction(LinesAction.addVBComment); export const convertToRegularExpression = () => linesFunction(LinesAction.convertToRegularExpression); export const expandSql = () => linesFunction(LinesAction.expandSql); export const listToListFamily = () => linesFunction(LinesAction.listToListFamily); +export const listToListWrappedComma = () => linesFunction(LinesAction.listToListWrappedComma); export const prettySql = () => linesFunction(LinesAction.prettySql); export const removeComment = () => linesFunction(LinesAction.removeComment); export const sortNormal = () => linesFunction(LinesAction.sortNormal);