Split by Space Reverse Join Sort lines (ascending, case sensitive)
PathWithoutBracketsSingularized
This commit is contained in:
Mike Phares 2022-03-10 14:19:47 -07:00
parent b91c5843df
commit eacebd708f
8 changed files with 58 additions and 5 deletions

Binary file not shown.

View File

@ -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.

View File

@ -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
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

View File

@ -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",

View File

@ -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"

View File

@ -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)

View File

@ -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",

View File

@ -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<boolean> | 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);