You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Updated: There was some good points regarding static methods on #116, so disregard thoughts specific to static.
Similar to the discussion related to the StatusBar, it seems there could also be some related improvements for Windows. Below points out a few I noticed while reviewing the APIs.
Namespace
The Windows namespace could be renamed to Community.VisualStudio.Toolkit.Windows to allow a separation for classes/files related to Windows. Use WindowFrame for example:
namespaceCommunity.VisualStudio.Toolkit.Windows{/// <summary>/// This class encapsulates an IVsWindowFrame instance and build functionality around./// </summary>[DebuggerDisplay("{Caption}")]publicclassWindowFrame:IVsWindowFrame,IVsWindowFrameNotify3{// code...}}
WindowFrame and OutputWindowPane
The Windows.cs class includes helper methods for WindowFrame /OutputWindowPane and currently requires an object instantiated to call them. However, there appears to be nothing holding them back to be static methods. It seems like those methods could also be moved/removed to their respective class. For example, CreateOutputWindowPaneAsync() could be removed as it already calls the respective OutputWindowPane.CreateAsync().
In addition, OutputWindowPane classes are currently stored under the Helpers folder. Those related files could be moved to the Windows folder where WindowsFrame files are stored.
WindowExtensions
WindowExtensions file is located under the ExtensionMethod folder. It might be good to keep extensions together as is currently. However, VS.Windows.ShowDialogAsync() calls into this method and could be removed. If so (and with the move of WindowFrame and OutputWindowPane from above), there would be no need for a Windows.cs file.
Side Notes
WindowExtensions currently has a namespace of Community.VisualStudio.Toolkit.Shared.ExtensionMethods and could be renamed to Community.VisualStudio.Toolkit.Extensions.
Window includes a WindowStartupLocation property, so ShowDialogAsync() could be simplified to the following:
Understanding VS is trying to make it simple for users, IMHO this makes it somewhat confusing as there are multiple ways to accomplish things along with long-term maintenance. As the APIs/documentation improve, users would begin to know how/where to locate the feature and confident they are using the recommended approach.
// BeforeusingCommunity.VisualStudio.Toolkit;awaitVS.Windows.GetOutputWindowPaneAsync(guid);// AfterusingCommunity.VisualStudio.Toolkit.Windows;awaitOutputWindowPane.GetAsync(guid);// or include full namespace if you wish...awaitCommunity.VisualStudio.Toolkit.Windows.OutputWindowPane.GetAsync(guid);
Final Thoughts
Similar to some opinions related to the StatusBar discussion, I'm starting to believe we could actually remove the need for VS as the toolkit's structure and documentation improve. Again, just my two pennies. Thanks for reading.
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Updated: There was some good points regarding static methods on #116, so disregard thoughts specific to static.
Similar to the discussion related to the StatusBar, it seems there could also be some related improvements for
Windows
. Below points out a few I noticed while reviewing the APIs.Namespace
The
Windows
namespace could be renamed toCommunity.VisualStudio.Toolkit.Windows
to allow a separation for classes/files related to Windows. UseWindowFrame
for example:WindowFrame and OutputWindowPane
The
Windows.cs
class includes helper methods forWindowFrame
/OutputWindowPane
and currently requires an object instantiated to call them. However, there appears to be nothing holding them back to be static methods. It seems like those methods could also be moved/removed to their respective class. For example, CreateOutputWindowPaneAsync() could be removed as it already calls the respective OutputWindowPane.CreateAsync().In addition,
OutputWindowPane
classes are currently stored under the Helpers folder. Those related files could be moved to the Windows folder whereWindowsFrame
files are stored.WindowExtensions
WindowExtensions
file is located under the ExtensionMethod folder. It might be good to keep extensions together as is currently. However,VS.Windows.ShowDialogAsync()
calls into this method and could be removed. If so (and with the move ofWindowFrame
andOutputWindowPane
from above), there would be no need for aWindows.cs
file.Side Notes
WindowExtensions
currently has a namespace ofCommunity.VisualStudio.Toolkit.Shared.ExtensionMethods
and could be renamed toCommunity.VisualStudio.Toolkit.Extensions
.Window
includes aWindowStartupLocation
property, soShowDialogAsync()
could be simplified to the following:Combining Points Above
Understanding
VS
is trying to make it simple for users, IMHO this makes it somewhat confusing as there are multiple ways to accomplish things along with long-term maintenance. As the APIs/documentation improve, users would begin to know how/where to locate the feature and confident they are using the recommended approach.Final Thoughts
Similar to some opinions related to the StatusBar discussion, I'm starting to believe we could actually remove the need for
VS
as the toolkit's structure and documentation improve. Again, just my two pennies. Thanks for reading.Beta Was this translation helpful? Give feedback.
All reactions