public Stream GetDefaultSettingsStream(Lifetime lifetime)
 {
   var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JetBrains.ReSharper.PowerToys.ZenCoding.resources.PredefinedZenCodingSettings.xml");
   Assertion.AssertNotNull(stream, "stream == null");
   lifetime.AddDispose(stream);
   return stream;
 }
        public Stream GetDefaultSettingsStream(Lifetime lifetime)
        {
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JetBrains.ReSharper.Plugins.Unity.Templates.templates.dotSettings");

            lifetime.AddDispose(stream);
            return(stream);
        }
 public Stream GetDefaultSettingsStream(Lifetime lifetime)
 {
     var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JetBrains.ReSharper.Plugins.CyclomaticComplexity.Resources.DefaultSettings.xml");
       Assertion.Assert(stream != null, "stream != null");
       lifetime.AddDispose(stream);
       return stream;
 }
        public Stream GetDefaultSettingsStream(Lifetime lifetime)
        {
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream(XmlPath);

            Assertion.AssertNotNull(stream, "stream != null");
            lifetime.AddDispose(stream);
            return(stream);
        }
 public T4OutsideSolutionSourceFileManager([NotNull] Lifetime lifetime, [NotNull] IDocumentFactory documentFactory, [NotNull] IProjectFileExtensions projectFileExtensions,
                                           [NotNull] PsiProjectFileTypeCoordinator psiProjectFileTypeCoordinator)
 {
     _documentFactory               = documentFactory;
     _projectFileExtensions         = projectFileExtensions;
     _psiProjectFileTypeCoordinator = psiProjectFileTypeCoordinator;
     lifetime.AddDispose(_sourceFiles);
 }
示例#6
0
        public Stream GetDefaultSettingsStream(Lifetime lifetime)
        {
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("PowerToys.CyclomaticComplexity.CyclomaticComplexity.dotSettings");

            Assertion.Assert(stream != null, "stream != null");
            lifetime.AddDispose(stream);
            return(stream);
        }
        public Stream GetDefaultSettingsStream(Lifetime lifetime)
        {
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JetBrains.ReSharper.Plugins.Godot.Templates.templates.dotSettings");

            Assertion.AssertNotNull(stream, "stream != null");
            lifetime.AddDispose(stream);
            return(stream);
        }
        public Stream GetDefaultSettingsStream(Lifetime lifetime)
        {
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JetBrains.ReSharper.Plugins.CyclomaticComplexity.Resources.DefaultSettings.xml");

            Assertion.Assert(stream != null, "stream != null");
            lifetime.AddDispose(stream);
            return(stream);
        }
        public Stream GetDefaultSettingsStream(Lifetime lifetime)
        {
            var stream = Assembly.GetExecutingAssembly().GetManifestResourceStream("JetBrains.ReSharper.PowerToys.ZenCoding.resources.PredefinedZenCodingSettings.xml");

            Assertion.AssertNotNull(stream, "stream == null");
            lifetime.AddDispose(stream);
            return(stream);
        }
示例#10
0
 public T4OutsideSolutionSourceFileManager([NotNull] Lifetime lifetime, [NotNull] IProjectFileExtensions projectFileExtensions,
                                           [NotNull] PsiProjectFileTypeCoordinator psiProjectFileTypeCoordinator, [NotNull] DocumentManager documentManager,
                                           [NotNull] ISolution solution)
 {
     _projectFileExtensions         = projectFileExtensions;
     _psiProjectFileTypeCoordinator = psiProjectFileTypeCoordinator;
     _documentManager = documentManager;
     _psiModule       = new PsiModuleOnFileSystemPaths(solution, "T4OutsideSolution", TargetFrameworkId.Default);
     lifetime.AddDispose(_sourceFiles);
 }
示例#11
0
        /// <summary>
        /// Initializes a new instance of the <see cref="T4FileDataCache"/> class.
        /// </summary>
        /// <param name="lifetime">The lifetime of this class.</param>
        /// <param name="psiFiles">The PSI manager.</param>
        /// <param name="directiveInfoManager">An instance of <see cref="DirectiveInfoManager"/>.</param>
        public T4FileDataCache([NotNull] Lifetime lifetime, [NotNull] PsiFiles psiFiles, [NotNull] DirectiveInfoManager directiveInfoManager)
        {
            _directiveInfoManager = directiveInfoManager;
            _fileDataChanged      = new Signal <Pair <IPsiSourceFile, T4FileDataDiff> >(lifetime, "T4FileDataCache.FileDataChanged");

            lifetime.AddBracket(
                () => psiFiles.PsiFileCreated += OnPsiFileChanged,
                () => psiFiles.PsiFileCreated -= OnPsiFileChanged);
            RegisterPsiChanged(lifetime, psiFiles);
            lifetime.AddDispose(_fileDataBySourceFile);
        }
 public T4OutsideSolutionSourceFileManager(
     [NotNull] Lifetime lifetime,
     [NotNull] IProjectFileExtensions projectFileExtensions,
     [NotNull] PsiProjectFileTypeCoordinator psiProjectFileTypeCoordinator,
     [NotNull] DocumentManager documentManager,
     [NotNull] ISolution solution,
     [NotNull] T4Environment t4Environment,
     [NotNull] IFileSystemTracker fileSystemTracker)
 {
     _projectFileExtensions         = projectFileExtensions;
     _psiProjectFileTypeCoordinator = psiProjectFileTypeCoordinator;
     _documentManager = documentManager;
     _psiModule       = new PsiModuleOnFileSystemPaths(solution, "T4OutsideSolution", t4Environment.TargetFrameworkId, fileSystemTracker, lifetime);
     lifetime.AddDispose(_sourceFiles);
 }
示例#13
0
        public T4FilePsiModule(
            Lifetime lifetime,
            [NotNull] IProjectFile projectFile,
            [NotNull] ChangeManager changeManager,
            [NotNull] IShellLocks shellLocks,
            [NotNull] IT4Environment t4Environment
            )
        {
            Lifetime = lifetime;
            lifetime.AddDispose(this);
            ProjectFile       = projectFile;
            Solution          = ProjectFile.GetSolution();
            PsiModules        = Solution.GetComponent <IPsiModules>();
            PsiServices       = Solution.GetComponent <IPsiServices>();
            ChangeManager     = changeManager;
            ShellLocks        = shellLocks;
            ChangeProvider    = new FakeChangeProvider();
            TargetFrameworkId = ProjectFile.SelectTargetFrameworkId(t4Environment);
            Project           = ProjectFile.GetProject().NotNull();
            var resolveContext = Project.IsMiscFilesProject()
                                ? UniversalModuleReferenceContext.Instance
                                : this.GetResolveContextEx(ProjectFile);

            AssemblyReferenceManager = new T4AssemblyReferenceManager(
                Solution.GetComponent <IAssemblyFactory>(),
                SourceFile,
                ProjectFile,
                resolveContext,
                shellLocks
                );
            ProjectReferenceManager = new T4ProjectReferenceManager(ProjectFile, Solution);

            changeManager.RegisterChangeProvider(lifetime, ChangeProvider);
            changeManager.AddDependency(lifetime, PsiModules, ChangeProvider);

            var documentManager = Solution.GetComponent <DocumentManager>();

            SourceFile = CreateSourceFile(ProjectFile, documentManager);
            Solution.GetComponent <T4DeclaredAssembliesManager>().FileDataChanged.Advise(lifetime, OnFileDataChanged);
            ChangeManager.ExecuteAfterChange(() =>
            {
                AssemblyReferenceManager.AddBaseReferences();
                NotifyModuleChange();
            });
        }
示例#14
0
        public T4FilePsiModule(
            Lifetime lifetime,
            [NotNull] IProjectFile projectFile,
            [NotNull] ChangeManager changeManager,
            [NotNull] IShellLocks shellLocks,
            [NotNull] IT4Environment t4Environment,
            [CanBeNull] TargetFrameworkId primaryTargetFrameworkId
            )
        {
            Lifetime = lifetime;
            lifetime.AddDispose(this);
            ProjectFile    = projectFile;
            Solution       = ProjectFile.GetSolution();
            PsiModules     = Solution.GetComponent <IPsiModules>();
            PsiServices    = Solution.GetComponent <IPsiServices>();
            ChangeManager  = changeManager;
            ShellLocks     = shellLocks;
            ChangeProvider = new T4WriteOnlyChangeProvider();
            changeManager.RegisterChangeProvider(lifetime, ChangeProvider);
            changeManager.AddDependency(lifetime, PsiModules, ChangeProvider);
            TargetFrameworkId = t4Environment.SelectTargetFrameworkId(primaryTargetFrameworkId, projectFile);
            Project           = ProjectFile.GetProject().NotNull();
            var resolveContext = Project.IsMiscFilesProject()
                                ? UniversalModuleReferenceContext.Instance
                                : this.GetResolveContextEx(ProjectFile);

            Assertion.Assert(resolveContext.TargetFramework == TargetFrameworkId, "Failed to select TargetFrameworkId");
            var documentManager = Solution.GetComponent <DocumentManager>();

            SourceFile = CreateSourceFile(ProjectFile, documentManager, resolveContext);
            AssemblyReferenceManager = new T4AssemblyReferenceManager(
                Solution.GetComponent <IAssemblyFactory>(),
                SourceFile,
                ProjectFile,
                resolveContext,
                shellLocks
                );

            Solution.GetComponent <T4DeclaredAssembliesManager>().FileDataChanged.Advise(lifetime, OnFileDataChanged);
            PersistentId = BuildPersistentId(primaryTargetFrameworkId);
            OriginalTargetFrameworkId = primaryTargetFrameworkId;
        }
        public ChangedTypesProvider(
            Lifetime lifetime,
            IShellLocks shellLocks,
            ChangeManager changeManager,
            DocumentManager documentManager,
            IPsiServices services)
        {
            _myServices        = services;
            _myLifetime        = lifetime;
            _myShellLocks      = shellLocks;
            _myDocumentManager = documentManager;
            _myChangedRanges   = new ConcurrentDictionary <IProjectFile, TextRange>();

            changeManager.Changed2.Advise(lifetime, OnChange);
            _myDocumentChangedEvent = shellLocks.CreateGroupingEvent(
                lifetime,
                "ChangedTypesProvider::DocumentChanged",
                s_updateInterval,
                OnProcessChangesEx);

            TypesChanged = new Signal <IReadOnlyCollection <ITypeElement> >(lifetime, "ChangedTypesProvider");
            _myLifetime.AddDispose(TypesChanged);
        }
 public Stream GetDefaultSettingsStream(Lifetime lifetime)
 {
     var stream = new MemoryStream(Resources.LiveTemplates);
     lifetime.AddDispose(stream);
     return stream;
 }