Skip to content

Commit

Permalink
Fixed issue with buildvision breaking on breaking build
Browse files Browse the repository at this point in the history
  • Loading branch information
StefanKert committed Apr 27, 2019
1 parent 7720135 commit 9251aca
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 10 deletions.
6 changes: 0 additions & 6 deletions src/BuildVision/Core/Services.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,6 @@ public static IVsSolution GetSolution(this IServiceProvider provider)
return GetGlobalService<SVsSolution, IVsSolution>(provider);
}

public static Solution GetDteSolution(this IServiceProvider provider)
{
var ret = provider.GetService(typeof(DTE)) as DTE2;
return ret.Solution;
}

public static IVsSolution GetSolution()
{
return GetGlobalService<SVsSolution, IVsSolution>();
Expand Down
4 changes: 2 additions & 2 deletions src/BuildVision/Services/BuildService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ private void RaiseCommand(VSConstants.VSStd97CmdID command)
private void SelectProjectInSolutionExplorer(IProjectItem projectItem)
{
var solutionExplorer = Core.Services.Dte2.ToolWindows.SolutionExplorer;
var project = _serviceProvider.GetDteSolution().FirstOrDefaultProject(x => x.UniqueName == projectItem.UniqueName);
var project = Core.Services.Dte2.Solution.FirstOrDefaultProject(x => x.UniqueName == projectItem.UniqueName);
var item = solutionExplorer.FindHierarchyItem(project);
if (item == null)
{
Expand All @@ -139,7 +139,7 @@ public void ProjectCopyBuildOutputFilesToClipBoard(IProjectItem projItem)
{
try
{
var project = _serviceProvider.GetDteSolution().FirstOrDefaultProject(x => x.UniqueName == projItem.UniqueName);
var project = Core.Services.Dte2.Solution.FirstOrDefaultProject(x => x.UniqueName == projItem.UniqueName);
var fileTypes = _packageSettingsProvider.Settings.ProjectItemSettings.CopyBuildOutputFileTypesToClipboard;
if (fileTypes.IsEmpty)
{
Expand Down
2 changes: 1 addition & 1 deletion src/BuildVision/Services/ErrorNavigationService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ public void NavigateToErrorItem(ErrorItem errorItem)
throw new ArgumentNullException(nameof(errorItem));
}

var project = _serviceProvider.GetDteSolution().FirstProject(x => x.FileName == errorItem.ProjectFile);
var project = Core.Services.Dte2.Solution.FirstProject(x => x.FileName == errorItem.ProjectFile);
if (!errorItem.CanNavigateTo)
{
return;
Expand Down
2 changes: 1 addition & 1 deletion src/BuildVision/Services/SolutionProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public SolutionProvider([Import(typeof(SVsServiceProvider))] IServiceProvider se

public void ReloadSolution()
{
_solution = _serviceProvider.GetDteSolution();
_solution = Services.Dte2.Solution;
RefrehSolutionModel();
}

Expand Down

0 comments on commit 9251aca

Please sign in to comment.