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

Group by document and not editor #382

Merged
merged 12 commits into from
Jan 17, 2022
Merged

Group by document and not editor #382

merged 12 commits into from
Jan 17, 2022

Conversation

AndreasArvidsson
Copy link
Member

fixes #316

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Looks good, but please add a test

src/util/targetUtils.ts Show resolved Hide resolved
Co-authored-by: Pokey Rule <pokey.rule@gmail.com>
@AndreasArvidsson
Copy link
Member Author

Almost every action uses this code so it's already thoroughly tested. Was there any thing in particular you want to me to test?

@pokey
Copy link
Member

pokey commented Jan 4, 2022

To my knowledge, we have no tests that operate on two editors with the same document, which is what this PR is supposed to fix. Would be good to have a test for that

@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented Jan 4, 2022

To my knowledge we can't do tests on multiple editors with our recorded tests framework. The code changes are used by almost every single action so we have regression testing. The issue with multiple editors for the same document is tested manually and I have no idea how to write a test for that.

@pokey
Copy link
Member

pokey commented Jan 4, 2022

Yeah you can't use test case recorder but it shouldn't be too bad. Have a look at eg https://github.com/pokey/cursorless-vscode/blob/14749f4f42b30fe8c7f7c9906ce79138982b0b2e/src/test/suite/backwardCompatibility.test.ts#L21-L36

@AndreasArvidsson
Copy link
Member Author

The only way to open the same document in multiple editors is to actually open a file on disk. A bit problematic on running unit tests isn't it?

@pokey
Copy link
Member

pokey commented Jan 4, 2022

The only way to open the same document in multiple editors is to actually open a file on disk. A bit problematic on running unit tests isn't it?

Can just make a temp file

@AndreasArvidsson
Copy link
Member Author

AndreasArvidsson commented Jan 5, 2022

Of course true. I might have a look at that when I have some time over.

I'm tempted to just merge this one and then create an issue about the missing test.

@pokey
Copy link
Member

pokey commented Jan 5, 2022

I'm not sure I want us to get in the habit of merging PRs without tests. I made an exception for #401 because it required #160, which is out of scope for that PR. Not sure I see why a test is out of scope for this PR

@AndreasArvidsson
Copy link
Member Author

@pokey Test added. I took special care to make sure that the hats are now in different editors of the same document.

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

Awesome test thank you! Left a tiny nit but otherwise looks great

src/test/suite/groupByDocument.test.ts Outdated Show resolved Hide resolved
Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

looks good!

@AndreasArvidsson AndreasArvidsson merged commit c79afbb into main Jan 17, 2022
@AndreasArvidsson AndreasArvidsson deleted the groupByDocument branch January 17, 2022 18:17
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.

Cannot issue move command from one editor to the other if they are both on the same document
2 participants