public void UpdateReferences(OmniSharp.Dnx.FrameworkProject frameworkProject) { EnsureCurrentFrameworkDefined(frameworkProject); List <string> fileReferences = frameworkProject.FileReferences.Keys.ToList(); savedFileReferences[frameworkProject.Framework] = fileReferences; List <string> projectReferences = frameworkProject.ProjectReferences.Keys.ToList(); savedProjectReferences[frameworkProject.Framework] = projectReferences; if (CurrentFramework != frameworkProject.Framework) { return; } try { addingReferences = true; RemoveExistingReferences(); UpdateReferences(fileReferences); UpdateProjectReferences(projectReferences); } finally { addingReferences = false; } }
void EnsureCurrentFrameworkDefined(OmniSharp.Dnx.FrameworkProject frameworkProject) { if (CurrentFramework == null) { CurrentFramework = frameworkProject.Project.ProjectsByFramework.Keys.FirstOrDefault(); } }
public void UpdateParseOptions(OmniSharp.Dnx.FrameworkProject frameworkProject, Microsoft.CodeAnalysis.ParseOptions options) { EnsureCurrentFrameworkDefined(frameworkProject); List <string> symbols = options.PreprocessorSymbolNames.ToList(); preprocessorSymbols[frameworkProject.Framework] = symbols; if (CurrentFramework != frameworkProject.Framework) { return; } UpdatePreprocessorSymbols(symbols); }
public void UpdateCompilationOptions( OmniSharp.Dnx.FrameworkProject frameworkProject, CSharpCompilationOptions compilationOptions, CSharpParseOptions parseOptions) { EnsureCurrentFrameworkDefined(frameworkProject); var options = new CSharpCompilationAndParseOptions(compilationOptions, parseOptions); savedCompilationOptions[frameworkProject.Framework] = options; if (CurrentFramework != frameworkProject.Framework) { return; } UpdateCompilationOptions(options); // Force the type system to reload the project otherwise any // warnings that are suppressed are still shown in the text editor. Project.NotifyModified("References"); }