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.
Fixes #154938
The
IAction
interface is currently marked as disposable but that's for no good reason. Because of theMenuItemAction
andSubmenuItemAction
are also "fake disposable" which has a ripple where various places assume and collect something to dispose just for the sake of calling empty methods. The "empty dispose" function forIAction
can be seen in various other places and all of that is cleaned-up with this PR.Another good consequence is that
createAndFillInActionBarActions
andcreateAndFillInContextMenuActions
don't return disposables anymore. This makes using menus simpler but #154939 plans even more simplifications.There is a few unfortunate places where we don't know if we are dealing with simple
IAction
-instances or disposableAction
-instances. For those cases I have introduced thedisposeIfDisposable
-util. The hope is that further clean-up removes the need for this