Change action names in schema to match without regex (#11520)

## Summary of the Pull Request
Currently when configuring the action
```json
{ "command": { "action": "closeTabsAfter" } }
```
we get a schema error in VSCode: `Matches multiple schemas when only one must validate.`.

The problem is that it matches both `closeTabsAfter` and `closeTab`, since the schema uses regex patterns to match instead of plain strings. I swapped the usage of `"pattern"` with `"const"` for all actions.

## PR Checklist
* [ ] Closes #xxx
* [x] CLA signed
* [ ] Tests added/passed
* [ ] Documentation updated
* [x] Schema updated
* [ ] I've discussed this with core contributors already. If not checked, I'm ready to accept this work might be rejected in favor of a different grand plan

## Detailed Description of the Pull Request / Additional comments

## Validation Steps Performed
I checked and this action configuration no longer errors.
This commit is contained in:
NotWearingPants 2021-10-19 00:24:35 +03:00 committed by GitHub
parent c1d326693c
commit fd93c54ae3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 31 additions and 31 deletions

View File

@ -506,7 +506,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "adjustFontSize" "const": "adjustFontSize"
}, },
"delta": { "delta": {
"type": "integer", "type": "integer",
@ -530,7 +530,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "copy" "const": "copy"
}, },
"singleLine": { "singleLine": {
"type": "boolean", "type": "boolean",
@ -566,7 +566,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "newTab" "const": "newTab"
} }
} }
} }
@ -582,7 +582,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "switchToTab" "const": "switchToTab"
}, },
"index": { "index": {
"type": "integer", "type": "integer",
@ -606,7 +606,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "movePane" "const": "movePane"
}, },
"index": { "index": {
"type": "integer", "type": "integer",
@ -630,7 +630,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "moveFocus" "const": "moveFocus"
}, },
"direction": { "direction": {
"$ref": "#/$defs/FocusDirection", "$ref": "#/$defs/FocusDirection",
@ -654,7 +654,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "swapPane" "const": "swapPane"
}, },
"direction": { "direction": {
"$ref": "#/$defs/FocusDirection", "$ref": "#/$defs/FocusDirection",
@ -678,7 +678,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "resizePane" "const": "resizePane"
}, },
"direction": { "direction": {
"$ref": "#/$defs/ResizeDirection", "$ref": "#/$defs/ResizeDirection",
@ -702,7 +702,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "sendInput" "const": "sendInput"
}, },
"input": { "input": {
"type": "string", "type": "string",
@ -729,7 +729,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "splitPane" "const": "splitPane"
}, },
"split": { "split": {
"$ref": "#/$defs/SplitDirection", "$ref": "#/$defs/SplitDirection",
@ -761,7 +761,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "openSettings" "const": "openSettings"
}, },
"target": { "target": {
"type": "string", "type": "string",
@ -788,7 +788,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "setTabColor" "const": "setTabColor"
}, },
"color": { "color": {
"$ref": "#/$defs/Color", "$ref": "#/$defs/Color",
@ -809,7 +809,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "setColorScheme" "const": "setColorScheme"
}, },
"colorScheme": { "colorScheme": {
"type": "string", "type": "string",
@ -833,7 +833,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "wt" "const": "wt"
}, },
"commandline": { "commandline": {
"type": "string", "type": "string",
@ -857,7 +857,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "closeOtherTabs" "const": "closeOtherTabs"
}, },
"index": { "index": {
"oneOf": [ "oneOf": [
@ -885,7 +885,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "closeTabsAfter" "const": "closeTabsAfter"
}, },
"index": { "index": {
"oneOf": [ "oneOf": [
@ -913,7 +913,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "closeTab" "const": "closeTab"
}, },
"index": { "index": {
"oneOf": [ "oneOf": [
@ -941,7 +941,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "scrollUp" "const": "scrollUp"
}, },
"rowsToScroll": { "rowsToScroll": {
"type": [ "type": [
@ -965,7 +965,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "scrollDown" "const": "scrollDown"
}, },
"rowsToScroll": { "rowsToScroll": {
"type": [ "type": [
@ -989,7 +989,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "moveTab" "const": "moveTab"
}, },
"direction": { "direction": {
"$ref": "#/$defs/MoveTabDirection", "$ref": "#/$defs/MoveTabDirection",
@ -1012,7 +1012,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "multipleActions" "const": "multipleActions"
}, },
"actions": { "actions": {
"$ref": "#/$defs/ShortcutAction", "$ref": "#/$defs/ShortcutAction",
@ -1037,7 +1037,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "commandPalette" "const": "commandPalette"
}, },
"launchMode": { "launchMode": {
"$ref": "#/$defs/CommandPaletteLaunchMode", "$ref": "#/$defs/CommandPaletteLaunchMode",
@ -1058,7 +1058,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "findMatch" "const": "findMatch"
}, },
"direction": { "direction": {
"$ref": "#/$defs/FindMatchDirection", "$ref": "#/$defs/FindMatchDirection",
@ -1085,7 +1085,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "newWindow" "const": "newWindow"
} }
} }
} }
@ -1101,7 +1101,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "prevTab" "const": "prevTab"
}, },
"tabSwitcherMode": { "tabSwitcherMode": {
"$ref": "#/$defs/SwitchToAdjacentTabArgs", "$ref": "#/$defs/SwitchToAdjacentTabArgs",
@ -1122,7 +1122,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "nextTab" "const": "nextTab"
}, },
"tabSwitcherMode": { "tabSwitcherMode": {
"$ref": "#/$defs/SwitchToAdjacentTabArgs", "$ref": "#/$defs/SwitchToAdjacentTabArgs",
@ -1143,7 +1143,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "renameTab" "const": "renameTab"
}, },
"title": { "title": {
"type": "string", "type": "string",
@ -1164,7 +1164,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "renameWindow" "const": "renameWindow"
}, },
"name": { "name": {
"type": "string", "type": "string",
@ -1185,7 +1185,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "focusPane" "const": "focusPane"
}, },
"id": { "id": {
"type": "integer", "type": "integer",
@ -1207,7 +1207,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "globalSummon" "const": "globalSummon"
}, },
"desktop": { "desktop": {
"type": "string", "type": "string",
@ -1258,7 +1258,7 @@
"properties": { "properties": {
"action": { "action": {
"type": "string", "type": "string",
"pattern": "quakeMode" "const": "quakeMode"
} }
} }
} }