diff --git a/type-script-helper-1.3.12.vsix b/type-script-helper-1.3.12.vsix new file mode 100644 index 0000000..45095ee Binary files /dev/null and b/type-script-helper-1.3.12.vsix differ diff --git a/type-script-helper/LICENSE.md b/type-script-helper/LICENSE.md new file mode 100644 index 0000000..457e704 --- /dev/null +++ b/type-script-helper/LICENSE.md @@ -0,0 +1,19 @@ +Copyright (c) Twitter Inc + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. \ No newline at end of file diff --git a/type-script-helper/README.md b/type-script-helper/README.md index dedc330..2ed773e 100644 --- a/type-script-helper/README.md +++ b/type-script-helper/README.md @@ -101,4 +101,12 @@ Open in New Window {open-in-new-window.open} Learned npm install will do similar to nuget restore Learned npm audit fix Learned npm audit fix --force -Learned npm run compile will do similar to build \ No newline at end of file +Learned npm run compile will do similar to build + +Quick Fix - Instance Field to Calisthenics + +## 1.3.12 +----------------------------------------------------------------------------------------------------------- + +Split by Space Reverse Join Sort lines (ascending, case sensitive) +PathWithoutBracketsSingularized \ No newline at end of file diff --git a/type-script-helper/package-lock.json b/type-script-helper/package-lock.json index fe61a85..4d1abfa 100644 --- a/type-script-helper/package-lock.json +++ b/type-script-helper/package-lock.json @@ -1,12 +1,12 @@ { "name": "type-script-helper", - "version": "1.3.11", + "version": "1.3.12", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "type-script-helper", - "version": "1.3.11", + "version": "1.3.12", "devDependencies": { "@types/glob": "^7.1.1", "@types/mocha": "^5.2.7", diff --git a/type-script-helper/package.json b/type-script-helper/package.json index 6e302ae..d6917f4 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.3.11", + "version": "1.3.12", "engines": { "vscode": "^1.40.0" }, @@ -32,6 +32,7 @@ "onCommand:replaceLinesHelper.removeComment", "onCommand:replaceLinesHelper.sortLength", "onCommand:replaceLinesHelper.sortNormal", + "onCommand:replaceLinesHelper.splitBySpaceReverseJoinSort", "onCommand:replaceLinesHelper.unwrapSql", "onCommand:replaceLinesHelper.wrapSqlCSharp", "onCommand:replaceLinesHelper.wrapSqlVB" @@ -114,6 +115,10 @@ "command": "replaceLinesHelper.sortNormal", "title": "My Sort lines (ascending, case sensitive)" }, + { + "command": "replaceLinesHelper.splitBySpaceReverseJoinSort", + "title": "Split by Space Reverse Join Sort lines (ascending, case sensitive)" + }, { "command": "replaceLinesHelper.unwrapSql", "title": "Un-wrap Sql" diff --git a/type-script-helper/src/extension.ts b/type-script-helper/src/extension.ts index f573499..b2176d3 100644 --- a/type-script-helper/src/extension.ts +++ b/type-script-helper/src/extension.ts @@ -55,6 +55,7 @@ export function activate(context: vscode.ExtensionContext) { vscode.commands.registerCommand('replaceLinesHelper.removeComment', replaceLinesHelper.removeComment), vscode.commands.registerCommand('replaceLinesHelper.sortLength', replaceLinesHelper.sortLength), vscode.commands.registerCommand('replaceLinesHelper.sortNormal', replaceLinesHelper.sortNormal), + vscode.commands.registerCommand('replaceLinesHelper.splitBySpaceReverseJoinSort', replaceLinesHelper.splitBySpaceReverseJoinSort), vscode.commands.registerCommand('replaceLinesHelper.unwrapSql', replaceLinesHelper.unwrapSql), vscode.commands.registerCommand('replaceLinesHelper.wrapSqlCSharp', replaceLinesHelper.wrapSqlCSharp), vscode.commands.registerCommand('replaceLinesHelper.wrapSqlVB', replaceLinesHelper.wrapSqlVB) diff --git a/type-script-helper/src/promiseLinesHelper.ts b/type-script-helper/src/promiseLinesHelper.ts index 07dca1f..10036f7 100644 --- a/type-script-helper/src/promiseLinesHelper.ts +++ b/type-script-helper/src/promiseLinesHelper.ts @@ -87,7 +87,7 @@ function codeGeneratorQuickPickLogic(): undefined { }, { label: "Path without Brackets (Singularized)", detail: "", - output: "%PathWithoutBracketSingularized%" + output: "%PathWithoutBracketsSingularized%" }, { label: "Suggested Type", detail: "Type based on values in *.json file", diff --git a/type-script-helper/src/replaceLinesHelper.ts b/type-script-helper/src/replaceLinesHelper.ts index 84c0106..6f86276 100644 --- a/type-script-helper/src/replaceLinesHelper.ts +++ b/type-script-helper/src/replaceLinesHelper.ts @@ -21,6 +21,7 @@ enum LinesAction { removeComment, sortLength, sortNormal, + splitBySpaceReverseJoinSort, unwrapSql, wrapSqlCSharp, wrapSqlVB @@ -282,6 +283,23 @@ function sortNormalLogic(lines: string[]): void { lines = transformers.reduce((currentLines, transform) => transform(currentLines), lines); } +function splitBySpaceReverseJoinSortLogic(lines: string[]): void { + var transformers: ArrayTransformer[] = []; + transformers.push(makeSorter()); + + for (let i = 0; i < lines.length; ++i) { + lines[i] = lines[i].split(' ').reverse().join(' '); + } + + removeBlanks(lines); + + for (let i = 0; i < lines.length; ++i) { + lines[i] = lines[i].split(' ').reverse().join(' '); + } + + lines = transformers.reduce((currentLines, transform) => transform(currentLines), lines); +} + function unwrapSqlLogic(lines: string[]): void { for (let i = 0; i < lines.length; ++i) { lines[i] = "//" + lines[i]. @@ -384,6 +402,7 @@ function linesFunction(linesAction: LinesAction): Thenable | undefined case LinesAction.removeComment: { removeCommentLogic(lines); break; } case LinesAction.sortLength: { sortLengthLogic(lines); break; } case LinesAction.sortNormal: { sortNormalLogic(lines); break; } + case LinesAction.splitBySpaceReverseJoinSort: { splitBySpaceReverseJoinSortLogic(lines); break; } case LinesAction.unwrapSql: { unwrapSqlLogic(lines); break; } case LinesAction.wrapSqlCSharp: { wrapSqlCSharpLogic(lines); break; } case LinesAction.wrapSqlVB: { wrapSqlVBLogic(lines); break; } @@ -409,6 +428,7 @@ export const pdsfToFixedWidth = () => linesFunction(LinesAction.pdsfToFixedWidth export const removeComment = () => linesFunction(LinesAction.removeComment); export const sortLength = () => linesFunction(LinesAction.sortLength); export const sortNormal = () => linesFunction(LinesAction.sortNormal); +export const splitBySpaceReverseJoinSort = () => linesFunction(LinesAction.splitBySpaceReverseJoinSort); export const unwrapSql = () => linesFunction(LinesAction.unwrapSql); export const wrapSqlCSharp = () => linesFunction(LinesAction.wrapSqlCSharp); export const wrapSqlVB = () => linesFunction(LinesAction.wrapSqlVB); \ No newline at end of file