Repository navigation
try to ignore history on editor open for quicksearch - #204880
Merged
Merged
Conversation
Andrea Mah (andreamah)
marked this pull request as ready for review
February 13, 2024 18:27
Justin Chen (justschen)
approved these changes
Feb 13, 2024
Contributor
|
Andrea Mah (@andreamah) sorry for the late response, I should have been the reviewer here, can you add me for future PRs in this area? I will post a follow up PR with some cleanup and thoughts. Thanks! |
| export class TestHistoryService implements IHistoryService { | ||
|
|
||
| declare readonly _serviceBrand: undefined; | ||
| declare shouldIgnoreActiveEditorChange: boolean; |
Contributor
There was a problem hiding this comment.
I think this is not very safe, this would not actually put the property on the class as far as I know but just declare it as type to be there.
| export class TestHistoryService implements IHistoryService { | ||
|
|
||
| declare readonly _serviceBrand: undefined; | ||
| declare shouldIgnoreActiveEditorChange: boolean; |
Contributor
There was a problem hiding this comment.
...same here
| this.editorSequencer.queue(async () => { | ||
| // disable and re-enable history service so that we can ignore this history entry | ||
| this._historyService.shouldIgnoreActiveEditorChange = true; | ||
| await this._editorService.openEditor({ |
Contributor
There was a problem hiding this comment.
Opening an editor can fail with an error thrown and so this would leave the history in ignore-mode, without ever setting it back. At least a try/finally is needed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related to #204853
Fixes #205135
cc Benjamin Pasero (@bpasero)