Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 068c43a

Browse files
committed
Give IActiveDocument a better name
1 parent 60b2a70 commit 068c43a

File tree

5 files changed

+17
-25
lines changed

5 files changed

+17
-25
lines changed

src/GitHub.Exports/GitHub.Exports.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@
111111
<Compile Include="Helpers\NotificationAwareObject.cs" />
112112
<Compile Include="Services\Connection.cs" />
113113
<Compile Include="Services\GitService.cs" />
114-
<Compile Include="Services\IActiveDocument.cs" />
114+
<Compile Include="Services\IActiveDocumentSnapshot.cs" />
115115
<Compile Include="Services\IGitService.cs" />
116116
<Compile Include="Services\IMenuHandler.cs" />
117117
<Compile Include="Services\IMenuProvider.cs" />

src/GitHub.Exports/Services/IActiveDocument.cs

Lines changed: 0 additions & 11 deletions
This file was deleted.
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
namespace GitHub.VisualStudio
2+
{
3+
public interface IActiveDocumentSnapshot
4+
{
5+
string Name { get; }
6+
int StartLine { get; }
7+
int EndLine { get; }
8+
}
9+
}

src/GitHub.VisualStudio/GitHub.VisualStudio.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,6 +212,7 @@
212212
<Compile Include="Base\TeamExplorerServiceHolder.cs" />
213213
<Compile Include="Converters\CountToVisibilityConverter.cs" />
214214
<Compile Include="Helpers\SharedDictionaryManager.cs" />
215+
<Compile Include="Helpers\ActiveDocumentSnapshot.cs" />
215216
<Compile Include="Menus\ShowGitHubPane.cs" />
216217
<Compile Include="Menus\AddConnection.cs" />
217218
<Compile Include="Base\MenuBase.cs" />
@@ -224,7 +225,6 @@
224225
<Compile Include="Helpers\Browser.cs" />
225226
<Compile Include="Helpers\Colors.cs" />
226227
<Compile Include="Helpers\Constants.cs" />
227-
<Compile Include="Services\ActiveDocument.cs" />
228228
<Compile Include="Services\ConnectionManager.cs" />
229229
<Compile Include="Services\Program.cs" />
230230
<Compile Include="Services\SharedResources.cs" />

src/GitHub.VisualStudio/Services/ActiveDocument.cs renamed to src/GitHub.VisualStudio/Helpers/ActiveDocumentSnapshot.cs

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,23 +7,19 @@
77

88
namespace GitHub.VisualStudio
99
{
10-
[Export(typeof(IActiveDocument))]
10+
[Export(typeof(IActiveDocumentSnapshot))]
1111
[PartCreationPolicy(CreationPolicy.NonShared)]
12-
class ActiveDocument : IActiveDocument
12+
class ActiveDocumentSnapshot : IActiveDocumentSnapshot
1313
{
1414
public string Name { get; private set; }
15-
public string ShortName { get; private set; }
16-
public int AnchorLine { get; private set; }
17-
public int AnchorColumn { get; private set; }
15+
public int StartLine { get; private set; }
1816
public int EndLine { get; private set; }
19-
public int EndColumn { get; private set; }
2017

2118
[ImportingConstructor]
22-
public ActiveDocument([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
19+
public ActiveDocumentSnapshot([Import(typeof(SVsServiceProvider))] IServiceProvider serviceProvider)
2320
{
24-
AnchorLine = AnchorColumn = EndLine = EndColumn = -1;
21+
StartLine = EndLine = -1;
2522
Name = Services.Dte2?.ActiveDocument?.FullName;
26-
ShortName = Services.Dte2?.ActiveDocument?.Name;
2723

2824
var textManager = serviceProvider.GetService(typeof(SVsTextManager)) as IVsTextManager;
2925
Debug.Assert(textManager != null, "No SVsTextManager service available");
@@ -34,10 +30,8 @@ public ActiveDocument([Import(typeof(SVsServiceProvider))] IServiceProvider serv
3430
if (ErrorHandler.Succeeded(textManager.GetActiveView(0, null, out view)) &&
3531
ErrorHandler.Succeeded(view.GetSelection(out anchorLine, out anchorCol, out endLine, out endCol)))
3632
{
37-
AnchorLine = anchorLine + 1;
38-
AnchorColumn = anchorCol + 1;
33+
StartLine = anchorLine + 1;
3934
EndLine = endLine + 1;
40-
EndColumn = endCol + 1;
4135
}
4236
}
4337
}

0 commit comments

Comments
 (0)