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

Fix positional inference #777

Merged
merged 13 commits into from
Jun 21, 2022
Merged

Conversation

pokey
Copy link
Member

@pokey pokey commented Jun 19, 2022

Separates inference so that we handle positional modifiers and non-positional modifiers separately, the way we did before #672. This way with the command "bring air after line bat and block cap", we infer "bring air after line bat and *after* block cap", as desired, just as we used to do before #672

Checklist

src/core/commandRunner/CommandRunner.ts Show resolved Hide resolved
mark: {type: decoratedSymbol, symbolColor: default, character: w}
modifiers:
- {type: position, position: end}
- {type: toRawSelection}
Copy link
Member Author

Choose a reason for hiding this comment

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

Note that we add "just" here to break inference chain, because we actually had a bug where we weren't doing inference for subtoken modifiers that had a position, even though we should have been

@@ -0,0 +1,62 @@
languageId: plaintext
Copy link
Member Author

@pokey pokey Jun 21, 2022

Choose a reason for hiding this comment

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

This test is the punchline: even though we have a modifier on the second destination target, we now infer "after" from the first destination target. Before, we would have stopped doing inference because it has a modifier "block"; now we handle position inference and non-positional inference independently, which was what we did before #672

@pokey pokey marked this pull request as ready for review June 21, 2022 14:19
@pokey pokey requested a review from AndreasArvidsson June 21, 2022 14:20
@AndreasArvidsson AndreasArvidsson merged commit 967a4e4 into main Jun 21, 2022
@AndreasArvidsson AndreasArvidsson deleted the pokey/fix-positional-inference branch June 21, 2022 14:59
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