예제 #1
0
        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;
            }
        }
예제 #2
0
 void EnsureCurrentFrameworkDefined(OmniSharp.Dnx.FrameworkProject frameworkProject)
 {
     if (CurrentFramework == null)
     {
         CurrentFramework = frameworkProject.Project.ProjectsByFramework.Keys.FirstOrDefault();
     }
 }
예제 #3
0
        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);
        }
예제 #4
0
        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");
        }