[PTRun][ValueGenerator]Add result entries showing how to use (#33490)

## Summary of the Pull Request
Added usage suggestion in PTRun Value Generator. 

<!-- Provide a more detailed description of the PR, other things fixed
or any additional comments/features here -->
## Detailed Description of the Pull Request / Additional comments
Added dropdown and give a basic description about the usage of value
generator

![image](https://github.com/microsoft/PowerToys/assets/24465401/2f9e01d1-1f5a-42b5-9234-f768b27124db)

Using fuzzy match to filter relevant queries

![image](https://github.com/microsoft/PowerToys/assets/24465401/dd0594bb-328a-4a8d-9d7c-e3b5732a8573)

---------

Co-authored-by: Heiko <61519853+htcfreek@users.noreply.github.com>
This commit is contained in:
Ahmada Yusril
2024-07-23 00:31:32 +09:00
committed by GitHub
parent 16a1fb7981
commit 1b27500231
7 changed files with 477 additions and 6 deletions

View File

@@ -64,7 +64,7 @@ namespace Community.PowerToys.Run.Plugin.ValueGenerator
algorithmName = HashAlgorithmName.SHA512;
break;
default:
throw new ArgumentException("Unknown SHA variant. Supported variants: SHA1, SHA256, SHA384, SHA512");
throw new FormatException("Unknown SHA variant. Supported variants: SHA1, SHA256, SHA384, SHA512");
}
if (content == string.Empty)
@@ -93,7 +93,7 @@ namespace Community.PowerToys.Run.Plugin.ValueGenerator
if (!int.TryParse(versionQuery, null, out version))
{
throw new ArgumentException("Could not determine requested GUID version");
throw new FormatException("Could not determine requested GUID version. Supported versions are 1, 3, 4 and 5");
}
}
@@ -103,7 +103,7 @@ namespace Community.PowerToys.Run.Plugin.ValueGenerator
if (sParameters.Length != 2)
{
throw new ArgumentException("GUID versions 3 and 5 require 2 parameters - a namespace GUID and a name");
throw new ArgumentException($"GUID version {version} require 2 parameters - a namespace GUID and a name.\nExample: uuidv{version} ns:<DNS, URL, OID, or X500> <your input>");
}
string namespaceParameter = sParameters[0];