Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add suffixedMatcher; use for keys #260

Merged
merged 4 commits into from
Sep 6, 2021
Merged

Add suffixedMatcher; use for keys #260

merged 4 commits into from
Sep 6, 2021

Conversation

pokey
Copy link
Member

@pokey pokey commented Sep 6, 2021

Allows saying "chuck key" and having the trailing : cleaned up

@@ -40,11 +40,11 @@ export function selectWithLeadingDelimiter(
editor: TextEditor,
node: SyntaxNode
): SelectionWithContext {
const leadingDelimiterToken = node.previousSibling;
const leadingNonDelimiterToken = node.previousSibling?.previousSibling;
Copy link
Member Author

@pokey pokey Sep 6, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that we now use the end of the token before the delimiter rather than the start of the delimiter itself. This way, for example, if you have foo = bar and say "chuck value", you won't get the trailing space after foo. See changed test case above (chuckValue)

@pokey pokey merged commit 8488e91 into main Sep 6, 2021
@pokey pokey deleted the pokey-key-prefix branch September 6, 2021 16:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants