Added fallback for preferred scope (#2648)

## Checklist

- [/] I have added
[tests](https://www.cursorless.org/docs/contributing/test-case-recorder/)
- [/] I have updated the
[docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and
[cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet)
- [/] I have not broken the cheatsheet
This commit is contained in:
Andreas Arvidsson 2024-08-09 00:29:43 +02:00 committed by GitHub
parent 36020662ef
commit 8829946a8b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -91,6 +91,9 @@ def get_modifier_callback(modifier: dict) -> Callable:
case "containingScope":
scope_type_type = modifier["scopeType"]["type"]
return get_simple_modifier_callback(f"{modifier_type}.{scope_type_type}")
case "preferredScope":
scope_type_type = modifier["scopeType"]["type"]
return get_simple_modifier_callback(f"containingScope.{scope_type_type}")
case "extendThroughStartOf":
if "modifiers" not in modifier:
return get_simple_modifier_callback(f"{modifier_type}.line")