-
Notifications
You must be signed in to change notification settings - Fork 8.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This specs out a lot of plans for snippets. We've already got these in the sxnui as "tasks", but we can do so very much more. This spec is a few years old now, but it's time for it to get promoted out of my draft branch. References: * #1595 * #7039 * #3121 * #10436 * #12927 * #12857 * #5790 * #15845 --------- Co-authored-by: Dustin L. Howett <[email protected]>
- Loading branch information
1 parent
fa40733
commit 8511f3d
Showing
24 changed files
with
695 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
import yaml | ||
import json | ||
import sys | ||
import os | ||
|
||
def parse_yaml_files(tool, directory): | ||
json_data = {} | ||
json_data["name"] = f"{tool}..." | ||
json_data["commands"] = [] | ||
|
||
for filename in os.listdir(directory): | ||
if filename.endswith(".yaml") or filename.endswith(".yml"): | ||
file_path = os.path.join(directory, filename) | ||
with open(file_path, 'r', encoding="utf-8") as file: | ||
try: | ||
yaml_data = yaml.safe_load(file) | ||
new_obj = {} | ||
command = {} | ||
command["input"] = yaml_data["command"] | ||
command["action"] ="sendInput" | ||
|
||
new_obj["command"]=command | ||
new_obj["name"] = yaml_data["name"] | ||
|
||
new_obj["description"] = yaml_data["description"] if "description" in yaml_data else "" | ||
json_data["commands"].append(new_obj) | ||
except yaml.YAMLError as e: | ||
print(f"Error parsing {filename}: {e}") | ||
sys.exit(-1) | ||
return json_data | ||
|
||
def main(directory) -> int: | ||
json_data = {} | ||
json_data["actions"] = [] | ||
|
||
for tool_dir in os.listdir(directory): | ||
# print(tool_dir) | ||
json_data["actions"].append(parse_yaml_files(tool_dir, os.path.join(directory, tool_dir))) | ||
print(json.dumps(json_data, indent=4)) | ||
return 0 | ||
|
||
if __name__ == '__main__': | ||
# Write this output to something like | ||
# "%localappdata%\Microsoft\Windows Terminal\Fragments\warp-workflows\actions.json" | ||
sys.exit(main("d:\\dev\\public\\workflows\\specs")) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+43.3 KB
doc/specs/#1595 - Suggestions UI/img/developers-already-do-this-000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1.02 MB
doc/specs/#1595 - Suggestions UI/img/shell-autocomplete-jul-2022-000.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+1010 KB
doc/specs/#1595 - Suggestions UI/img/shell-completion-menu-2023-02-21.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.3 KB
doc/specs/#1595 - Suggestions UI/img/shell-completion-tooltip-000.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+431 KB
doc/specs/#1595 - Suggestions UI/img/vscode-shell-autocomplete-000.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+37.9 KB
doc/specs/#1595 - Suggestions UI/img/vscode-shell-integration-gutter-mark.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.