public ProjectInformationResponse CurrentProject(Request request) { var document = _workspace.GetDocument(request.FileName); var msBuildContextProject = _msbuildContext?.GetProject(document?.Project.FilePath); var dnxContextProject = _dnxContext?.GetProject(document?.Project.FilePath); MSBuildProject msBuildProjectItem = null; DnxProject dnxProjectItem = null; if (msBuildContextProject != null) { msBuildProjectItem = new MSBuildProject(msBuildContextProject); } if (dnxContextProject != null) { dnxProjectItem = new DnxProject(dnxContextProject); } return new ProjectInformationResponse { MsBuildProject = msBuildProjectItem, DnxProject = dnxProjectItem }; }
public async Task CanGetDnxProject() { var project1 = CreateProjectWithSourceFile("project1.json", "file1.cs"); var project2 = CreateProjectWithSourceFile("project2.json", "file2.cs"); var project3 = CreateProjectWithSourceFile("project3.json", "file3.cs"); var project = await GetProjectContainingSourceFile("file2.cs"); var expectedProject = new DnxProject(project2); Assert.Equal(expectedProject.GlobalJsonPath, project.GlobalJsonPath); Assert.Equal(expectedProject.Name, project.Name); Assert.Equal(expectedProject.Path, project.Path); Assert.Equal(expectedProject.Commands.Count, project.Commands.Count); Assert.Equal(expectedProject.Frameworks.Count, project.Frameworks.Count); }
public void Update(OmniSharp.Models.DnxProject project) { this.project = project; base.OnExecutionTargetsChanged (); }