Skip to content

Added function listenForDocumentChanges#126

Merged
AndreasArvidsson merged 9 commits intomasterfrom
listenForDocumentChanges
Jul 24, 2021
Merged

Added function listenForDocumentChanges#126
AndreasArvidsson merged 9 commits intomasterfrom
listenForDocumentChanges

Conversation

@AndreasArvidsson
Copy link
Copy Markdown
Member

          const promise = listenForDocumentChanges(editor, [
            originalSelections,
            newSelections,
          ]);

          await commands.executeCommand(this.command);

          const [originalSelectionsUpdated, newSelectionsUpdated] =
            await promise;

@AndreasArvidsson AndreasArvidsson requested a review from pokey as a code owner July 20, 2021 10:50
@AndreasArvidsson AndreasArvidsson force-pushed the listenForDocumentChanges branch from 140757f to 39f1d3b Compare July 21, 2021 12:16
@AndreasArvidsson AndreasArvidsson marked this pull request as draft July 21, 2021 12:35
@AndreasArvidsson AndreasArvidsson marked this pull request as ready for review July 21, 2021 16:19
pokey and others added 5 commits July 24, 2021 03:34
* A possible approach

* Update CalculateChanges.ts

Co-authored-by: Andreas Arvidsson <andreas.arvidsson87@gmail.com>
Copy link
Copy Markdown
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.

LGTM after some tweaks but see #138

Comment thread src/CommandAction.ts

const originalEditor = window.activeTextEditor;

const thatMark = await this.runCommandAndUpdateSelections(targets);
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

@AndreasArvidsson I reworked the abstractions a bit so I believe we don't care now whether the command made any changes

Copy link
Copy Markdown
Member Author

@AndreasArvidsson AndreasArvidsson Jul 24, 2021

Choose a reason for hiding this comment

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

As long as it doesn't hang waiting for changes I'm happy

@AndreasArvidsson AndreasArvidsson merged commit 56af51f into master Jul 24, 2021
@AndreasArvidsson AndreasArvidsson deleted the listenForDocumentChanges branch July 24, 2021 21:41
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