Skip to content

Commit

Permalink
Add a spec for "Snippets" (#17329)
Browse files Browse the repository at this point in the history
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
zadjii-msft and DHowett committed Jun 22, 2024
1 parent fa40733 commit 8511f3d
Show file tree
Hide file tree
Showing 24 changed files with 695 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .github/actions/spelling/allow/allow.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ perlw
postmodern
Powerline
ptys
pwn
pwshw
qof
qps
Expand Down Expand Up @@ -80,6 +81,7 @@ und
vsdevcmd
westus
workarounds
wtconfig
XBox
YBox
yeru
Expand Down
648 changes: 648 additions & 0 deletions doc/specs/#1595 - Suggestions UI/Snippets.md

Large diffs are not rendered by default.

45 changes: 45 additions & 0 deletions doc/specs/#1595 - Suggestions UI/dump-workflows.py
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.
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.
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.
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.

0 comments on commit 8511f3d

Please sign in to comment.