Skip to content

Persist settings search when reloaded#59704

Merged
roblourens merged 2 commits intomicrosoft:masterfrom
usatiuk:persistent-settings-search
Oct 3, 2018
Merged

Persist settings search when reloaded#59704
roblourens merged 2 commits intomicrosoft:masterfrom
usatiuk:persistent-settings-search

Conversation

@usatiuk
Copy link
Contributor

@usatiuk usatiuk commented Sep 30, 2018

Implements #57289

@msftclas
Copy link

msftclas commented Sep 30, 2018

CLA assistant check
All CLA requirements met.

@usatiuk usatiuk changed the title persist settings search when reloaded Persist settings search when reloaded Sep 30, 2018
@roblourens roblourens added this to the October 2018 milestone Oct 1, 2018
// Make sure that all extensions' settings are included in search results
const cachedState = this.editorMemento.loadState(this.group, this.input);
if (cachedState && cachedState.searchQuery) {
this.triggerSearch(cachedState.searchQuery);
Copy link
Member

Choose a reason for hiding this comment

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

I'm not totally sure, but since this will trigger a render when it's done, can we avoid calling renderTree here?

Also, is this always safe to call before settingsTreeModel has been created?

@roblourens
Copy link
Member

It looks like the goal is to only persist the state when the editor was closed while visible, but for some reason that's not working for me. It always persists the state. Does it work for you?

Copy link
Contributor Author

@usatiuk usatiuk Oct 1, 2018

Choose a reason for hiding this comment

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

Apparently, this.input is already cleared there, so clearState doesn't do anything

Copy link
Contributor Author

@usatiuk usatiuk Oct 1, 2018

Choose a reason for hiding this comment

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

If we clean the state just before clearing input, it works, and has basically the same effect as if in setEditorVisible (clear the state when settings are invisible)

Copy link
Contributor Author

@usatiuk usatiuk Oct 1, 2018

Choose a reason for hiding this comment

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

Calling this before settingsTreeModel has been created doesn't seem to cause any issue, but I put it here just in case.

@usatiuk
Copy link
Contributor Author

usatiuk commented Oct 1, 2018

Now it should work as intended.

Copy link
Member

@roblourens roblourens left a comment

Choose a reason for hiding this comment

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

Sorry for the delay, this looks great! Thanks for the PR!

@roblourens roblourens merged commit 90fc4c9 into microsoft:master Oct 3, 2018
@usatiuk usatiuk deleted the persistent-settings-search branch October 4, 2018 12:48
@github-actions github-actions bot locked and limited conversation to collaborators Mar 27, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants