Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stop using IWorkspaceProjectContext version of the project file name #4049

Merged
merged 1 commit into from
Oct 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

using System;

using Microsoft.VisualStudio.ProjectSystem.LanguageServices;
using Microsoft.VisualStudio.Shell.Interop;

namespace Microsoft.VisualStudio.ProjectSystem.VS.Build
Expand Down Expand Up @@ -32,17 +31,17 @@ public string File
set;
}

public string GetFileFullPath(IActiveWorkspaceProjectContextHost projectContextHost)
public string GetFileFullPath(string projectFile)
{
string projectFile = ProjectFile;
if (string.IsNullOrEmpty(projectFile))
string baseFilePath = ProjectFile;
if (string.IsNullOrEmpty(baseFilePath))
{
projectFile = projectContextHost.ActiveProjectContext?.ProjectFilePath;
baseFilePath = projectFile;
}

if (!string.IsNullOrEmpty(projectFile) && !string.IsNullOrEmpty(File))
if (!string.IsNullOrEmpty(baseFilePath) && !string.IsNullOrEmpty(File))
{
return TryMakeRooted(projectFile, File);
return TryMakeRooted(baseFilePath, File);
}

return string.Empty;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,14 @@ internal partial class LanguageServiceErrorListProvider : IVsErrorListProvider
{
private static readonly Task<AddMessageResult> s_handledAndStopProcessing = Task.FromResult(AddMessageResult.HandledAndStopProcessing);
private static readonly Task<AddMessageResult> s_notHandled = Task.FromResult(AddMessageResult.NotHandled);
private readonly UnconfiguredProject _project;
private readonly IActiveWorkspaceProjectContextHost _projectContextHost;
private IVsLanguageServiceBuildErrorReporter2 _languageServiceBuildErrorReporter;

[ImportingConstructor]
public LanguageServiceErrorListProvider(UnconfiguredProject project, IActiveWorkspaceProjectContextHost projectContextHost)
{
_project = project;
_projectContextHost = projectContextHost;
}

Expand Down Expand Up @@ -66,7 +68,7 @@ private async Task<AddMessageResult> AddMessageCoreAsync(TargetGeneratedError er
details.ColumnNumberForErrorList,
details.EndLineNumberForErrorList,
details.EndColumnNumberForErrorList,
details.GetFileFullPath(_projectContextHost));
details.GetFileFullPath(_project.FullPath));
handled = true;
}
catch (NotImplementedException)
Expand Down