Added actions from #57321 to the 'No Settings Found'-message#59739
Merged
roblourens merged 3 commits intomicrosoft:masterfrom Oct 5, 2018
NiclasvanEyk:master
Merged
Added actions from #57321 to the 'No Settings Found'-message#59739roblourens merged 3 commits intomicrosoft:masterfrom NiclasvanEyk:master
roblourens merged 3 commits intomicrosoft:masterfrom
NiclasvanEyk:master
Conversation
See #57321 for more info
roblourens
reviewed
Oct 1, 2018
| import { IPreferencesService, ISearchResult, ISettingsEditorModel, ISettingsEditorOptions, SettingsEditorOptions, SettingValueType } from 'vs/workbench/services/preferences/common/preferences'; | ||
| import { SettingsEditor2Input } from 'vs/workbench/services/preferences/common/preferencesEditorInput'; | ||
| import { Settings2EditorModel } from 'vs/workbench/services/preferences/common/preferencesModels'; | ||
| import { Disposable } from 'vscode'; |
Member
There was a problem hiding this comment.
Don't import from 'vscode' here, that module is for extensions. You can use IDisposable from lifecycle.ts
Member
There was a problem hiding this comment.
Actually you don't need to add that array because SettingsEditor2 already extends Disposable, the _register method adds disposable objects to its internal set of disposables.
Contributor
Author
There was a problem hiding this comment.
Thanks for pointing me in the right direction. I removed the import and replaced the array-logic with calls to _register
roblourens
reviewed
Oct 1, 2018
| parsedQuery.tags.forEach(tag => this.viewState.tagFilters.add(tag)); | ||
|
|
||
| // show or hide 'Clear Filters'-link | ||
| this.clearFilterLinkContainer.style.display = this.viewState.tagFilters.size > 0 |
Member
There was a problem hiding this comment.
Maybe this should go in renderResultCountMessages?
Contributor
Author
There was a problem hiding this comment.
Yes, this seems like a more appropriate place for this logic. I moved it.
The previous solution involved an own solution with an array of disposables. The new solution makes use of the _register-method from the Displosable class.
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.
This PR contains a first suggestion for adding the two actions for clearing all filters and clearing the search to the 'No Settings Found'-message on the settings-search as described in #57321.
The first one is only shown, if there are actually any filters active. The second one is always shown.
I am not sure how to deal with the translations here, since I was not able to find similar, already translated texts I added new ones. If this is not the correct way, please help me here.
As I am new to the codebase I am also not sure, whether the approach with the disposables array is the right one. Is there any documentation about the life cycle of the editor parts available?