Fix typos and examples in vscode examples
This commit is contained in:
@@ -33,7 +33,7 @@ def check_json_keybindings(actual: str, expected: str, **options) -> float:
|
|||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
return 0.0
|
return 0.0
|
||||||
expected = expected['expect']
|
expected = expected['expected']
|
||||||
if expected in data:
|
if expected in data:
|
||||||
return 1.0
|
return 1.0
|
||||||
else:
|
else:
|
||||||
@@ -55,7 +55,7 @@ def check_json_settings(actual: str, expected: str, **options) -> float:
|
|||||||
with open(actual, 'r') as f:
|
with open(actual, 'r') as f:
|
||||||
data = json.load(f)
|
data = json.load(f)
|
||||||
|
|
||||||
expect = expected['expect']
|
expect = expected['expected']
|
||||||
data_copy = copy.deepcopy(data)
|
data_copy = copy.deepcopy(data)
|
||||||
data_copy.update(expect)
|
data_copy.update(expect)
|
||||||
if data == data_copy:
|
if data == data_copy:
|
||||||
@@ -93,7 +93,7 @@ def compare_config(actual: str, rules: Dict, **options) -> float:
|
|||||||
with open(actual) as f1:
|
with open(actual) as f1:
|
||||||
actual_text = f1.read()
|
actual_text = f1.read()
|
||||||
|
|
||||||
if actual_text == rules['expect']:
|
if actual_text == rules['expected']:
|
||||||
return 1.0
|
return 1.0
|
||||||
return 0.0
|
return 0.0
|
||||||
|
|
||||||
@@ -110,7 +110,7 @@ def compare_answer(actual: str, rules: Dict, **options) -> float:
|
|||||||
if not actual:
|
if not actual:
|
||||||
return 0.
|
return 0.
|
||||||
|
|
||||||
if actual == rules['expect']:
|
if actual == rules['expected']:
|
||||||
return 1.0
|
return 1.0
|
||||||
|
|
||||||
# TODO: can use text embedding to get non-zero return
|
# TODO: can use text embedding to get non-zero return
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {
|
"expected": {
|
||||||
"editor.wordWrapColumn": 50
|
"editor.wordWrapColumn": 50
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {}
|
"expected": {}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|||||||
@@ -86,7 +86,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": "project"
|
"expected": "project"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|||||||
@@ -67,7 +67,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {
|
"expected": {
|
||||||
"folders": [
|
"folders": [
|
||||||
{"path": "project"},
|
{"path": "project"},
|
||||||
{"path": "data1"},
|
{"path": "data1"},
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {
|
"expected": {
|
||||||
"files.autoSave": "afterDelay",
|
"files.autoSave": "afterDelay",
|
||||||
"files.autoSaveDelay": 500
|
"files.autoSaveDelay": 500
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect":
|
"expected":
|
||||||
{
|
{
|
||||||
"key": "ctrl+j",
|
"key": "ctrl+j",
|
||||||
"command": "workbench.action.focusActiveEditorGroup",
|
"command": "workbench.action.focusActiveEditorGroup",
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {"debug.focusEditorOnBreak": false}
|
"expected": {"debug.focusEditorOnBreak": false}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|||||||
@@ -1,9 +1,16 @@
|
|||||||
{
|
{
|
||||||
"id": "982d12a5-beab-424f-8d38-d2a48429e511",
|
"id": "982d12a5-beab-424f-8d38-d2a48429e511",
|
||||||
"snapshot": "vscode",
|
"snapshot": "vscode",
|
||||||
"instruction": "Please help me change the color theme of VS Code to Dark.",
|
"instruction": "Please help me change the color theme of VS Code to Visual Studio Dark.",
|
||||||
"source": "https://www.youtube.com/watch?v=ORrELERGIHs",
|
"source": "https://www.youtube.com/watch?v=ORrELERGIHs",
|
||||||
"config": [
|
"config": [
|
||||||
|
{
|
||||||
|
"type": "command",
|
||||||
|
"parameters": {
|
||||||
|
"command": "SETTINGS_PATH=\"$HOME/.config/Code/User/settings.json\"; [ ! -f \"$SETTINGS_PATH\" ] && echo '{\"workbench.colorTheme\": \"Red\"}' > \"$SETTINGS_PATH\" || (grep -q \"workbench.colorTheme\" \"$SETTINGS_PATH\" && sed -i 's/\"workbench.colorTheme\": \"[^\"]*\"/\"workbench.colorTheme\": \"Red\"/' \"$SETTINGS_PATH\" || jq '. + {\"workbench.colorTheme\": \"Red\"}' \"$SETTINGS_PATH\" > temp.json && mv temp.json \"$SETTINGS_PATH\")",
|
||||||
|
"shell": true
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"type": "launch",
|
"type": "launch",
|
||||||
"parameters": {
|
"parameters": {
|
||||||
@@ -28,14 +35,13 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": "2"
|
"expected": "{\"workbench.colorTheme\": \"Visual Studio Dark\"}\n"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
"type": "vscode_config",
|
"type": "vm_file",
|
||||||
"vscode_extension_command": "GetColorTheme",
|
"path": "/home/user/.config/Code/User/settings.json",
|
||||||
"path": "/home/user/GetColorTheme.txt",
|
"dest": "settings.json"
|
||||||
"dest": "GetColorTheme.txt"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {"workbench.editor.wrapTabs": true}
|
"expected": {"workbench.editor.wrapTabs": true}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"result": {
|
"result": {
|
||||||
|
|||||||
@@ -50,7 +50,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {
|
"expected": {
|
||||||
"files.exclude": {
|
"files.exclude": {
|
||||||
"**/__pycache__": true
|
"**/__pycache__": true
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect": {
|
"expected": {
|
||||||
"python.analysis.diagnosticSeverityOverrides": {"reportMissingImports": "none"}
|
"python.analysis.diagnosticSeverityOverrides": {"reportMissingImports": "none"}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
"expected": {
|
"expected": {
|
||||||
"type": "rule",
|
"type": "rule",
|
||||||
"rules": {
|
"rules": {
|
||||||
"expect":
|
"expected":
|
||||||
{
|
{
|
||||||
"key": "ctrl+f",
|
"key": "ctrl+f",
|
||||||
"command": "-list.find",
|
"command": "-list.find",
|
||||||
|
|||||||
Reference in New Issue
Block a user