Search Google
This commit is contained in:
parent
9efe4e506b
commit
b7453ff4f1
BIN
type-script-helper-1.2.4.vsix
Normal file
BIN
type-script-helper-1.2.4.vsix
Normal file
Binary file not shown.
@ -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.3",
|
||||
"version": "1.2.4",
|
||||
"engines": {
|
||||
"vscode": "^1.40.0"
|
||||
},
|
||||
@ -22,6 +22,7 @@
|
||||
"onCommand:helper.listToListWrappedComma",
|
||||
"onCommand:helper.prettySql",
|
||||
"onCommand:helper.removeComment",
|
||||
"onCommand:helper.searchGoogle",
|
||||
"onCommand:helper.sortLength",
|
||||
"onCommand:helper.sortNormal",
|
||||
"onCommand:helper.unwrapSql",
|
||||
@ -39,6 +40,7 @@
|
||||
{ "command": "helper.listToListWrappedComma", "title": "List to list wrapped comma" },
|
||||
{ "command": "helper.prettySql", "title": "Pretty Sql" },
|
||||
{ "command": "helper.removeComment", "title": "Remove comment" },
|
||||
{ "command": "helper.searchGoogle", "title": "Search Google" },
|
||||
{ "command": "helper.sortLength", "title": "Sort by Length" },
|
||||
{ "command": "helper.sortNormal", "title": "My Sort lines (ascending, case sensitive)" },
|
||||
{ "command": "helper.unwrapSql", "title": "Un-wrap Sql" },
|
||||
|
@ -34,6 +34,7 @@ export function activate(context: vscode.ExtensionContext) {
|
||||
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.searchGoogle', helper.searchGoogle),
|
||||
vscode.commands.registerCommand('helper.sortLength', helper.sortLength),
|
||||
vscode.commands.registerCommand('helper.sortNormal', helper.sortNormal),
|
||||
vscode.commands.registerCommand('helper.unwrapSql', helper.unwrapSql),
|
||||
|
@ -15,6 +15,7 @@ enum LinesAction {
|
||||
prettySql,
|
||||
pdsfToFixedWidth,
|
||||
removeComment,
|
||||
searchGoogle,
|
||||
sortLength,
|
||||
sortNormal,
|
||||
unwrapSql,
|
||||
@ -157,6 +158,14 @@ function removeCommentLogic(lines: string[]): void {
|
||||
}
|
||||
}
|
||||
|
||||
function searchGoogleLogic(lines: string[]): void {
|
||||
for (let i = 0; i < lines.length; ++i) {
|
||||
vscode.env.openExternal(
|
||||
vscode.Uri.parse(`https://www.google.com/search?q=${lines[i]}`)
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
function makeSorter(algorithm?: SortingAlgorithm): ArrayTransformer {
|
||||
return function (lines: string[]): string[] {
|
||||
return lines.sort(algorithm);
|
||||
@ -267,6 +276,7 @@ function linesFunction(linesAction: LinesAction): Thenable<boolean> | undefined
|
||||
case LinesAction.listToListWrappedComma: { listToListWrappedCommaLogic(lines); break; }
|
||||
case LinesAction.prettySql: { prettySqlLogic(lines); break; }
|
||||
case LinesAction.removeComment: { removeCommentLogic(lines); break; }
|
||||
case LinesAction.searchGoogle: { searchGoogleLogic(lines); break; }
|
||||
case LinesAction.sortLength: { sortLengthLogic(lines); break; }
|
||||
case LinesAction.sortNormal: { sortNormalLogic(lines); break; }
|
||||
case LinesAction.unwrapSql: { unwrapSqlLogic(lines); break; }
|
||||
@ -287,6 +297,7 @@ export const listToListWrappedComma = () => linesFunction(LinesAction.listToList
|
||||
export const prettySql = () => linesFunction(LinesAction.prettySql);
|
||||
export const pdsfToFixedWidth = () => linesFunction(LinesAction.pdsfToFixedWidth);
|
||||
export const removeComment = () => linesFunction(LinesAction.removeComment);
|
||||
export const searchGoogle = () => linesFunction(LinesAction.searchGoogle);
|
||||
export const sortLength = () => linesFunction(LinesAction.sortLength);
|
||||
export const sortNormal = () => linesFunction(LinesAction.sortNormal);
|
||||
export const unwrapSql = () => linesFunction(LinesAction.unwrapSql);
|
||||
|
@ -8,6 +8,7 @@
|
||||
],
|
||||
"sourceMap": true,
|
||||
"rootDir": "src",
|
||||
"resolveJsonModule": true,
|
||||
"strict": true /* enable all strict type-checking options */
|
||||
/* Additional Checks */
|
||||
// "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */
|
||||
|
Loading…
x
Reference in New Issue
Block a user