ScopeManager - Remove a NamedScope by its name?

 

Hey!


How can i remove a NamedScope by its name?
At the moment i use RemoveAllSets:

this.scopeManager = NamedScopeManager.getInstance(this.project);
this.scopeManager.removeAllSets();

...but this remove all Scopes, even previous user defined ones

(Relates to: https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000550024-How-to-provide-custom-search-find-scope?input_string=ScopeManager)

0
Avatar
Permanently deleted user

Not very good API but still you can:

1) Obtain an array1 as scopeManager.getEditableScopes()

2) Copy the array1 to some array2 skipping NamedScope you want to remove

3) Update scopes with scopeManager.setScopes(array2)

0

请先登录再写评论。