public TypeProvidersExternalProcess(Lifetime lifetime, ILogger logger, IShellLocks locks,
                                     IProcessStartInfoPatcher processInfoPatcher, JetProcessRuntimeRequest request, NuGetVersion nuGetVersion)
     : base(lifetime, logger, locks, processInfoPatcher, request)
 {
     myRequest      = request;
     myNuGetVersion = nuGetVersion;
 }
 public UnityEventsElementContainer(ISolution solution, IShellLocks shellLocks, MetaFileGuidCache guidCache, AssetDocumentHierarchyElementContainer elementContainer)
 {
     mySolution   = solution;
     myShellLocks = shellLocks;
     myGuidCache  = guidCache;
     myAssetDocumentHierarchyElementContainer = elementContainer;
 }
Ejemplo n.º 3
0
 public T4MacroResolutionCache(
     Lifetime lifetime,
     [NotNull] IShellLocks locks,
     [NotNull] IPersistentIndexManager persistentIndexManager
     ) : base(lifetime, locks, persistentIndexManager, T4MacroResolutionDataMarshaller.Instance)
 {
 }
Ejemplo n.º 4
0
    public void Open(Lifetime lifetime, IShellLocks shellLocks, ChangeManager changeManager, ISolution solution, DocumentManager documentManager, IActionManager actionManager, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, JetPopupMenus jetPopupMenus)
    {
      Debug.Assert(!IsOpened);

      _solution = solution;
      DocumentManager = documentManager;
      _jetPopupMenus = jetPopupMenus;
      changeManager.Changed2.Advise(lifetime, Handler);
      lifetime.AddAction(Close);
      var expandAction = actionManager.Defs.TryGetActionDefById(GotoDeclarationAction.ACTION_ID);
      if (expandAction != null)
      {
        var postfixHandler = new GotoDeclarationHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

        lifetime.AddBracket(
          FOpening: () => actionManager.Handlers.AddHandler(expandAction, postfixHandler),
          FClosing: () => actionManager.Handlers.RemoveHandler(expandAction, postfixHandler));
      }
      
      var findUsagesAction = actionManager.Defs.GetActionDef<FindUsagesAction>();
      var findUsagesHandler = new FindUsagesHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

      lifetime.AddBracket(
        FOpening: () => actionManager.Handlers.AddHandler(findUsagesAction, findUsagesHandler),
        FClosing: () => actionManager.Handlers.RemoveHandler(findUsagesAction, findUsagesHandler));
    }
Ejemplo n.º 5
0
        public void Open(Lifetime lifetime, IShellLocks shellLocks, ChangeManager changeManager, ISolution solution, DocumentManager documentManager, IActionManager actionManager, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, JetPopupMenus jetPopupMenus)
        {
            Debug.Assert(!IsOpened);

            _solution       = solution;
            DocumentManager = documentManager;
            _jetPopupMenus  = jetPopupMenus;
            changeManager.Changed2.Advise(lifetime, Handler);
            lifetime.AddAction(Close);
            var expandAction = actionManager.Defs.TryGetActionDefById(GotoDeclarationAction.ACTION_ID);

            if (expandAction != null)
            {
                var postfixHandler = new GotoDeclarationHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

                lifetime.AddBracket(
                    FOpening: () => actionManager.Handlers.AddHandler(expandAction, postfixHandler),
                    FClosing: () => actionManager.Handlers.RemoveHandler(expandAction, postfixHandler));
            }

            var findUsagesAction  = actionManager.Defs.GetActionDef <FindUsagesAction>();
            var findUsagesHandler = new FindUsagesHandler(lifetime, shellLocks, commandProcessor, changeUnitFactory, this);

            lifetime.AddBracket(
                FOpening: () => actionManager.Handlers.AddHandler(findUsagesAction, findUsagesHandler),
                FClosing: () => actionManager.Handlers.RemoveHandler(findUsagesAction, findUsagesHandler));
        }
Ejemplo n.º 6
0
        public PerProjectSettings(Lifetime lifetime, ISolution solution, ChangeManager changeManager,
                                  ModuleReferenceResolveSync moduleReferenceResolveSync,
                                  IViewableProjectsCollection projects,
                                  ISettingsSchema settingsSchema,
                                  SettingsStorageProvidersCollection settingsStorageProviders, IShellLocks locks,
                                  ILogger logger, InternKeyPathComponent interned,
                                  UnityProjectFileCacheProvider unityProjectFileCache)
        {
            mySolution                 = solution;
            myChangeManager            = changeManager;
            mySettingsSchema           = settingsSchema;
            mySettingsStorageProviders = settingsStorageProviders;
            myLocks    = locks;
            myLogger   = logger;
            myInterned = interned;
            myUnityProjectFileCache = unityProjectFileCache;
            myProjectMountPoints    = new Dictionary <IProject, SettingsStorageMountPoint>();
            myProjectLifetimes      = new Dictionary <IProject, Lifetime>();

            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, this, moduleReferenceResolveSync);

            projects.Projects.View(lifetime, (projectLifetime, project) =>
            {
                myProjectLifetimes.Add(project, projectLifetime);

                if (!project.IsUnityProject())
                {
                    return;
                }

                InitialiseProjectSettings(project);
            });
        }
Ejemplo n.º 7
0
        public TutorialStepPresenter(IStepView view, string contentPath, Lifetime lifetime, ISolution solution, IPsiFiles psiFiles,
                                     TextControlManager textControlManager, IShellLocks shellLocks, IEditorManager editorManager,
                                     DocumentManager documentManager, IUIApplication environment, IActionManager actionManager,
                                     IPsiServices psiServices, IActionShortcuts shortcutManager)
        {
            _stepView          = view;
            Lifetime           = lifetime;
            Solution           = solution;
            PsiFiles           = psiFiles;
            TextControlManager = textControlManager;
            ShellLocks         = shellLocks;
            EditorManager      = editorManager;
            DocumentManager    = documentManager;
            Environment        = environment;
            ActionManager      = actionManager;
            _contentPath       = contentPath;
            _codeNavigator     = new SourceCodeNavigator(lifetime, solution, psiFiles, textControlManager, shellLocks, editorManager,
                                                         documentManager, environment);
            _steps = new Dictionary <int, TutorialStep>();
            _steps = TutorialXmlReader.ReadTutorialSteps(contentPath);

            _currentStepId = TutorialXmlReader.ReadCurrentStep(contentPath);
            CurrentStep    = _steps[_currentStepId];

            lifetime.AddBracket(
                () => { _stepView.NextStep += GoNext; },
                () => { _stepView.NextStep -= GoNext; });

            ProcessStep();
        }
Ejemplo n.º 8
0
        public void ShowTutorialWindow(int tutorialId, Lifetime lifetime,
                                       ISolution solution, IPsiFiles psiFiles, ChangeManager changeManager, TextControlManager textControlManager,
                                       IShellLocks shellLocks, IEditorManager editorManager, DocumentManager documentManager,
                                       IUIApplication environment,
                                       IActionManager actionManager, WindowsHookManager windowsHookManager, IPsiServices psiServices,
                                       IActionShortcuts shortcutManager, IColorThemeManager colorThemeManager, IThreading threading)
        {
            var contentPath = _globalSettings.GetPath(tutorialId, PathType.WorkCopyContentFile);

            _runningTutorial = tutorialId;

            threading.ExecuteOrQueue("RunTutorialWindow", () =>
            {
                _tutorialWindow = new TutorialWindow(contentPath, lifetime, this, solution, psiFiles, changeManager,
                                                     textControlManager,
                                                     shellLocks, editorManager, documentManager, environment, actionManager, _toolWindowClass,
                                                     windowsHookManager, colorThemeManager);

                lifetime.AddBracket(
                    () =>
                {
                    _tutorialWindow.Show();
                    _homeWindow.HideLoadingImages();
                },
                    () =>
                {
                    _tutorialWindow.Close();
                    _tutorialWindow  = null;
                    _runningTutorial = 0;
                    _homeWindow.EnableButtons(true);
                });
            });
        }
Ejemplo n.º 9
0
 public T4PsiModuleProvider([NotNull] Lifetime lifetime, [NotNull] IShellLocks shellLocks, [NotNull] ChangeManager changeManager, [NotNull] T4Environment t4Environment)
 {
     _lifetime = lifetime;
     _shellLocks = shellLocks;
     _changeManager = changeManager;
     _t4Environment = t4Environment;
 }
Ejemplo n.º 10
0
        public void Execute(IDataContext context, DelegateExecute nextExecute)
        {
            ISolution   solution = context.GetData(ProjectModelDataConstants.SOLUTION);
            IShellLocks locks    = context.GetComponent <IShellLocks>();
            PopupWindowContextSource popupWindowContextSource = context.GetData(UIDataConstants.PopupWindowContextSource);

            Debug.Assert(popupWindowContextSource != null, "popupWindowContextSource != null");
            Debug.Assert(solution != null, "solution != null");

            void Atomic(LifetimeDefinition lifetimeDefinition, Lifetime lifetime)
            {
                var controller = new GotoGeneratorController(
                    lifetime,
                    solution,
                    locks,
                    context,
                    Shell.Instance.GetComponent <IMainWindowPopupWindowContext>(),
                    false /* enableMulticore */
                    );

                GotoByNameMenu menu = new GotoByNameMenu(
                    context.GetComponent <GotoByNameMenuComponent>(),
                    lifetimeDefinition,
                    controller.Model,
                    context.GetComponent <UIApplication>().MainWindow.TryGetActiveWindow(),
                    solution.GetComponent <GotoByNameModelManager>().GetSearchTextData(context, controller),
                    popupWindowContextSource.Create(lifetime)
                    );

                MakeBusyIconVisibleOnEmptyFilter(menu, controller.Model, lifetime);
            }

            Lifetimes.Define(solution.GetLifetime(), null /* id */, Atomic);
        }
 public VsUnityVersionPropertiesExtenderProvider(Lifetime lifetime, IShellLocks locks, UnityVersion unityVersion, UnityApi unityApi)
 {
     myLifetime     = lifetime;
     myLocks        = locks;
     myUnityVersion = unityVersion;
     myUnityApi     = unityApi;
 }
    public TypeInterfaceToolWindowRegistrar(Lifetime lifetime,
                                    ToolWindowManager toolWindowManager,
                                    IShellLocks locks,
                                    ISettingsStore settingsStore,
                                    IActionManager actionManager,
                                    IActionBarManager actionBarManager,
                                    IShortcutManager shortcutManager,
                                    TypeInterfaceToolWindowDescriptor toolWindowDescriptor,
                                    ITheming theming,
                                    IThemedIconManager themedIconManager, IColorThemeManager colorThemeManager)
    {
      myLifetime = lifetime;
      myLocks = locks;
      mySettingsStore = settingsStore;
      myActionBarManager = actionBarManager;
      myTheming = theming;
      myThemedIconManager = themedIconManager;
      myColorThemeManager = colorThemeManager;

      myToolWindowClass = toolWindowManager.Classes[toolWindowDescriptor];
      myToolWindowClass.RegisterEmptyContent(
        lifetime,
        lt =>
          {
            var emptyLabel = new RichTextLabel { BackColor = SystemColors.Control, Dock = DockStyle.Fill };
            emptyLabel.RichTextBlock.Add(new RichText("No hierarchies open", new TextStyle(FontStyle.Bold)));
            emptyLabel.RichTextBlock.Add(
              new RichText("Use " + actionManager.GetHowToExecuteAction(shortcutManager, typeof(BrowseTypeHierarchyAction)), TextStyle.Default));
            emptyLabel.RichTextBlock.Add(new RichText("on a type to see hierarchy", TextStyle.Default));
            emptyLabel.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
            return emptyLabel.BindToLifetime(lt);
          });
    }
        public GotoWordController([NotNull] Lifetime lifetime,
                                  [NotNull] IShellLocks shellLocks,
                                  [NotNull] IProjectModelElement projectElement,
                                  [CanBeNull] ITextControl textControl,
                                  [NotNull] IDocumentMarkupManager markupManager)
            : base(lifetime, new GotoByNameModel(lifetime), shellLocks)
        {
            myShellLocks     = shellLocks;
            myTextControl    = textControl;
            myProjectElement = projectElement;
            mySelectedItem   = new Property <object>(lifetime, "SelectedItem");

            var projectFile = projectElement as IProjectFile;

            if (projectFile != null)
            {
                myCurrentFile = projectFile.ToSourceFile();

                if (textControl != null)
                {
                    myHighlighter = new LocalOccurrencesHighlighter(
                        lifetime, shellLocks, textControl, markupManager);
                    SelectedItem.Change.Advise(lifetime, AdviceSelectionItem);
                }
            }

            InitializeModel(lifetime, Model);
        }
        public TypeInterfaceToolWindowRegistrar(Lifetime lifetime,
                                                ToolWindowManager toolWindowManager,
                                                IShellLocks locks,
                                                ISettingsStore settingsStore,
                                                IActionManager actionManager,
                                                IActionBarManager actionBarManager,
                                                IShortcutManager shortcutManager,
                                                TypeInterfaceToolWindowDescriptor toolWindowDescriptor,
                                                ITheming theming,
                                                IThemedIconManager themedIconManager, IColorThemeManager colorThemeManager)
        {
            myLifetime          = lifetime;
            myLocks             = locks;
            mySettingsStore     = settingsStore;
            myActionBarManager  = actionBarManager;
            myTheming           = theming;
            myThemedIconManager = themedIconManager;
            myColorThemeManager = colorThemeManager;

            myToolWindowClass = toolWindowManager.Classes[toolWindowDescriptor];
            myToolWindowClass.RegisterEmptyContent(
                lifetime,
                lt =>
            {
                var emptyLabel = new RichTextLabel {
                    BackColor = SystemColors.Control, Dock = DockStyle.Fill
                };
                emptyLabel.RichTextBlock.Add(new RichText("No hierarchies open", new TextStyle(FontStyle.Bold)));
                emptyLabel.RichTextBlock.Add(
                    new RichText("Use " + actionManager.GetHowToExecuteAction(shortcutManager, typeof(BrowseTypeHierarchyAction)), TextStyle.Default));
                emptyLabel.RichTextBlock.Add(new RichText("on a type to see hierarchy", TextStyle.Default));
                emptyLabel.RichTextBlock.Parameters = new RichTextBlockParameters(8, ContentAlignment.MiddleCenter);
                return(emptyLabel.BindToLifetime(lt));
            });
        }
        public LambdaPsiHost(Lifetime lifetime, ISolution solution, ISymbolCache symbolCache, PsiIconManager psiIconManager, IconHost iconHost,
                             ProjectModelViewHost projectModelViewHost, IShellLocks locks, ILogger logger)
        {
            _symbolCache          = symbolCache;
            _psiIconManager       = psiIconManager;
            _iconHost             = iconHost;
            _projectModelViewHost = projectModelViewHost;
            _locks  = locks;
            _logger = logger;

            var model = solution.GetProtocolSolution().GetLambdaPsiModel();

            model.DetermineHandlersRequest.Advise(lifetime, request =>
            {
                var handlers = DetermineHandlers(solution);
                model.DetermineHandlersResponse(new DetermineHandlersResponse(request.RequestId, handlers));
            });

            model.IsHandlerExistRequest.Advise(lifetime, request =>
            {
                var className  = request.ClassName;
                var methodName = request.MethodName;
                var projectId  = request.ProjectId;

                var handlerExists = IsHandlerExists(lifetime, projectId, className, methodName);
                model.IsHandlerExistResponse(new HandlerExistResponse(request.RequestId, handlerExists));
            });
        }
        public UnityReferencesTracker(
            Lifetime lifetime,

            IEnumerable <IHandler> handlers,
            ISolution solution,

            ISolutionLoadTasksScheduler scheduler,
            IShellLocks shellLocks,

            ModuleReferenceResolveSync moduleReferenceResolveSync,
            ChangeManager changeManager,
            IViewableProjectsCollection projects,
            ILogger logger
            )
        {
            myProjectLifetimes = new Dictionary <IProject, Lifetime>();

            myHandlers   = handlers.ToList();
            myLifetime   = lifetime;
            myLogger     = logger;
            mySolution   = solution;
            myShellLocks = shellLocks;
            myModuleReferenceResolveSync = moduleReferenceResolveSync;
            myChangeManager = changeManager;
            myProjects      = projects;

            scheduler.EnqueueTask(new SolutionLoadTask("Checking for Unity projects", SolutionLoadTaskKinds.Done, Register));
        }
 public AssetMethodsElementContainer(IShellLocks shellLocks, ISolution solution, IPersistentIndexManager persistentIndexManager, AssetDocumentHierarchyElementContainer elementContainer)
 {
     myShellLocks             = shellLocks;
     mySolution               = solution;
     myPersistentIndexManager = persistentIndexManager;
     myAssetDocumentHierarchyElementContainer = elementContainer;
 }
Ejemplo n.º 18
0
 internal T4ResolveProject([NotNull] ISolution solution, [NotNull] IShellLocks shellLocks, [NotNull] PlatformID platformID, [NotNull] IUserDataHolder dataHolder)
 {
     _shellLocks        = shellLocks;
     _solution          = solution;
     _dataHolder        = dataHolder;
     _projectProperties = new T4ResolveProjectProperties(platformID);
 }
Ejemplo n.º 19
0
 public T4TestsDeclaredAssembliesManager(
     Lifetime lifetime,
     [NotNull] IPsiFiles psiFiles,
     [NotNull] IShellLocks locks
     ) : base(lifetime, psiFiles, locks)
 {
 }
Ejemplo n.º 20
0
 public SilverlightElementsSource(
     SilverlightUnitTestProvider provider, 
     IMsTestServices msTestServices, 
     IMsTestAttributesProvider msTestAttributesProvider, IUnitTestElementManager unitTestElementManager, IUnitTestCategoryFactory unitTestCategoryFactory, IShellLocks shellLocks)
     : base(provider, msTestServices, msTestAttributesProvider, unitTestElementManager, unitTestCategoryFactory, shellLocks)
 {
 }
 public GotoWordIndexProvider(
     [NotNull] Lifetime lifetime, [NotNull] ITaskHost taskHost, [NotNull] IShellLocks shellLocks)
 {
     myLifetime   = lifetime;
     myTaskHost   = taskHost;
     myShellLocks = shellLocks;
 }
Ejemplo n.º 22
0
        public MainChecker(Lifetime lifetime, TutStep.TutorialStep step, ISolution solution, IPsiFiles psiFiles,
                           TextControlManager textControlManager, IShellLocks shellLocks,
                           IEditorManager editorManager, DocumentManager documentManager)
        {
            _lifetime           = lifetime;
            _currentStep        = step;
            _solution           = solution;
            _textControlManager = textControlManager;
            _documentManager    = documentManager;
            _editorManager      = editorManager;

            if (step.Check.Actions != null)
            {
                _stepActionChecker = new StepActionChecker(lifetime, shellLocks, psiFiles);
            }

            if (step.Check.Method == null)
            {
                return;
            }
            _stepPsiChecker = new StepPsiChecker(lifetime, solution, psiFiles,
                                                 shellLocks);
            _stepNavigationChecker = new StepNavigationChecker(lifetime, solution, psiFiles, textControlManager,
                                                               shellLocks);
        }
 public TestFileAnalysisDaemonStageProcess(IShellLocks shellLocks, IDaemonProcess daemonProcess, IContextBoundSettingsStore settings, ICSharpFile file)
     : base(daemonProcess, file)
 {
     _myShellLocks    = shellLocks;
     _myDaemonProcess = daemonProcess;
     _settings        = settings;
 }
        public XunitTestElementsSource(XunitServiceProvider services, SearchDomainFactory searchDomainFactory, IShellLocks shellLocks)
        {
            this.services = services;
            this.searchDomainFactory = searchDomainFactory;

            metadataElementsSource = new MetadataElementsSource(Logger.GetLogger(typeof (XunitTestElementsSource)), shellLocks);
        }
 public AssetInspectorValuesContainer(IShellLocks shellLocks, AssetDocumentHierarchyElementContainer hierarchyElementContainer, IEnumerable <IAssetInspectorValueDeserializer> assetInspectorValueDeserializer, ILogger logger)
 {
     myShellLocks = shellLocks;
     myHierarchyElementContainer = hierarchyElementContainer;
     myLogger        = logger;
     myDeserializers = assetInspectorValueDeserializer.OrderByDescending(t => t.Order).ToList();
 }
Ejemplo n.º 26
0
        public BinaryUnityFileCache(Lifetime lifetime, ISolution solution,
                                    IPersistentIndexManager persistentIndexManager, IShellLocks locks,
                                    ChangeManager changeManager)
            : base(lifetime, persistentIndexManager, BinaryFileCacheItem.Marshaller)
        {
            myGroupingEvent = solution.Locks.GroupingEvents.CreateEvent(lifetime, "UnityRefresherOnSaveEvent",
                                                                        TimeSpan.FromMilliseconds(500), Rgc.Guarded, () =>
            {
                var changedFiles = new JetHashSet <IPsiSourceFile>(myChangedFiles);
                myChangedFiles.Clear();

                if (changedFiles.Count > 0)
                {
                    locks.ExecuteWithWriteLock(() => changeManager.ExecuteAfterChange(() =>
                    {
                        var builder = new PsiModuleChangeBuilder();
                        foreach (var file in changedFiles)
                        {
                            if (file.IsValid())
                            {
                                builder.AddFileChange(file, PsiModuleChange.ChangeType.Modified);
                            }
                        }

                        changeManager.OnProviderChanged(solution, builder.Result, SimpleTaskExecutor.Instance);
                    }));
                }
            });
            myChangedFiles = new JetHashSet <IPsiSourceFile>();
        }
Ejemplo n.º 27
0
        public UnityVersion(UnityProjectFileCacheProvider unityProjectFileCache,
                            ISolution solution, IFileSystemTracker fileSystemTracker, Lifetime lifetime,
                            IShellLocks locks)
        {
            myUnityProjectFileCache = unityProjectFileCache;
            mySolution = solution;

            if (locks.Dispatcher.IsAsyncBehaviorProhibited) // for tests
            {
                return;
            }

            var projectVersionTxtPath = mySolution.SolutionDirectory.Combine("ProjectSettings/ProjectVersion.txt");

            fileSystemTracker.AdviseFileChanges(lifetime,
                                                projectVersionTxtPath,
                                                _ => { myVersionFromProjectVersionTxt = TryGetVersionFromProjectVersion(projectVersionTxtPath); });
            myVersionFromProjectVersionTxt = TryGetVersionFromProjectVersion(projectVersionTxtPath);

            var editorInstanceJsonPath = mySolution.SolutionDirectory.Combine("Library/EditorInstance.json");

            fileSystemTracker.AdviseFileChanges(lifetime,
                                                editorInstanceJsonPath,
                                                _ => { myVersionFromEditorInstanceJson = TryGetApplicationPathFromEditorInstanceJson(editorInstanceJsonPath); });
            myVersionFromEditorInstanceJson = TryGetApplicationPathFromEditorInstanceJson(editorInstanceJsonPath);
        }
        public UnityPluginInstaller(
            Lifetime lifetime,
            ILogger logger,
            ISolution solution,
            IShellLocks shellLocks,
            UnityPluginDetector detector,
            RdNotificationsModel notifications,
            ISettingsStore settingsStore,
            PluginPathsProvider pluginPathsProvider,
            UnityVersionDetector unityVersionDetector)
        {
            myPluginInstallations = new JetHashSet <FileSystemPath>();

            myLifetime             = lifetime;
            myLogger               = logger;
            mySolution             = solution;
            myShellLocks           = shellLocks;
            myDetector             = detector;
            myNotifications        = notifications;
            myPluginPathsProvider  = pluginPathsProvider;
            myUnityVersionDetector = unityVersionDetector;

            myBoundSettingsStore = settingsStore.BindToContextLive(myLifetime, ContextRange.Smart(solution.ToDataContext()));
            myQueue = new ProcessingQueue(myShellLocks, myLifetime);
        }
        public GotoGeneratorController(
            [NotNull] Lifetime lifetime,
            [NotNull] ISolution solution,
            [NotNull] IShellLocks locks,
            [NotNull] IDataContext context,
            IMainWindowPopupWindowContext mainWindowPopupWindowContext,
            bool enableMulticore) :
            base(lifetime, solution, solution, LibrariesFlag.SolutionOnly, locks, enableMulticore, new GotoByNameModel(lifetime), mainWindowPopupWindowContext)
        {
            this.EtcItemIcon     = IdeThemedIcons.SearchResults.Id;
            this.ItemsPassFilter = new Property <Func <IOccurrence, bool> >("ItemsPassFilter", this.DefaultFilter);
            GotoByNameModelManager instance = GotoByNameModelManager.GetInstance(solution);

            instance.ProcessModel <GotoGeneratorModelInitilizer>(this.Model, lifetime, this.GetType());

            ITextControl textControl = context.GetData(TextControlDataConstants.TEXT_CONTROL);

            Debug.Assert(textControl != null, "textControl != null");

            var dataBuilder           = new CSharpContextActionDataBuilder();
            var generatorDataProvider = new GeneratorDataProvider((ICSharpContextActionDataProvider)dataBuilder.Build(solution, textControl));

            var generatorsProvider        = solution.GetComponent <GeneratorsProvider>();
            var applicableGeneratorsCache = new ApplicableGeneratorsCache(generatorsProvider, generatorDataProvider);

            this.GotoContext.PutData(ApplicableGeneratorsCacheKey, applicableGeneratorsCache);

            _executionHost = context.GetComponent <GeneratorExecutionHost>();
        }
Ejemplo n.º 30
0
        public PrefabImportCache(Lifetime lifetime, ISolution solution, ISettingsStore store, MetaFileGuidCache metaFileGuidCache, UnityExternalFilesModuleFactory unityExternalFilesModuleFactory, IShellLocks shellLocks)
        {
            myMetaFileGuidCache = metaFileGuidCache;
            myShellLocks        = shellLocks;
            metaFileGuidCache.GuidChanged.Advise(lifetime, e =>
            {
                myShellLocks.AssertWriteAccessAllowed();
                var set = new HashSet <Guid>();
                if (e.oldGuid != null)
                {
                    InvalidateImportCache(e.oldGuid.Value, set);
                }

                if (e.newGuid != null)
                {
                    InvalidateImportCache(e.newGuid.Value, set);
                }
            });

            myUnityExternalFilesPsiModule = unityExternalFilesModuleFactory.PsiModule;

            var boundSettingsStoreLive = store.BindToContextLive(lifetime, ContextRange.Smart(solution.ToDataContext()));

            myCacheEnabled = boundSettingsStoreLive.GetValueProperty(lifetime, (UnitySettings key) => key.IsPrefabCacheEnabled);
        }
Ejemplo n.º 31
0
        public LambdaPsiHost(ISolution solution, ISymbolCache symbolCache, PsiIconManager psiIconManager, IconHost iconHost,
                             ProjectModelViewHost projectModelViewHost, IShellLocks locks, ILogger logger)
        {
            _symbolCache          = symbolCache;
            _psiIconManager       = psiIconManager;
            _iconHost             = iconHost;
            _projectModelViewHost = projectModelViewHost;
            _locks  = locks;
            _logger = logger;

            var model = solution.GetProtocolSolution().GetLambdaPsiModel();

            model.DetermineHandlers.Set((lifetime, unit) =>
            {
                var task = new RdTask <List <HandlerCompletionItem> >();
                task.Set(DetermineHandlers(solution));
                return(task);
            });

            model.IsHandlerExists.Set((lifetime, request) =>
            {
                var task       = new RdTask <bool>();
                var className  = request.ClassName;
                var methodName = request.MethodName;
                var projectId  = request.ProjectId;

                var handlerExists = IsHandlerExists(lifetime, projectId, className, methodName);
                task.Set(handlerExists);
                return(task);
            });
        }
Ejemplo n.º 32
0
        internal T4PsiModule([NotNull] Lifetime lifetime, [NotNull] IPsiModules psiModules, [NotNull] DocumentManager documentManager,
                             [NotNull] ChangeManager changeManager, [NotNull] IAssemblyFactory assemblyFactory, [NotNull] IShellLocks shellLocks,
                             [NotNull] IProjectFile projectFile, [NotNull] T4FileDataCache fileDataCache, [NotNull] T4Environment t4Environment,
                             [NotNull] OutputAssemblies outputAssemblies)
        {
            _lifetime = lifetime;
            lifetime.AddAction(Dispose);

            _psiModules      = psiModules;
            _assemblyFactory = assemblyFactory;
            _changeManager   = changeManager;
            _shellLocks      = shellLocks;

            _projectFile = projectFile;
            IProject project = projectFile.GetProject();

            Assertion.AssertNotNull(project, "project != null");
            _project  = project;
            _solution = project.GetSolution();

            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, psiModules, this);

            _t4Environment    = t4Environment;
            _outputAssemblies = outputAssemblies;
            _resolveProject   = new T4ResolveProject(lifetime, _solution, _shellLocks, t4Environment.PlatformID, project);

            _sourceFile = CreateSourceFile(projectFile, documentManager);

            _isValid = true;
            fileDataCache.FileDataChanged.Advise(lifetime, OnDataFileChanged);
            AddBaseReferences();
        }
 public LinkedTypesNavigationProvider(
     IShellLocks locks,
     ITooltipManager tooltipManager,
     IFeaturePartsContainer manager)
     : base(locks, tooltipManager, manager)
 {
 }
Ejemplo n.º 34
0
        public UnityPluginInstaller(
            Lifetime lifetime,
            ILogger logger,
            ISolution solution,
            IShellLocks shellLocks,
            UnityPluginDetector detector,
            RdNotificationsModel notifications,
            ISettingsStore settingsStore,
            ApplicationPackages applicationPackages,
            ApplicationPackagesLocallyInstalled applicationPackagesLocallyInstalled,
            IEnumerable <ApplicationPackageArtifact> packages, IDeployedPackagesExpandLocationResolver resolver)
        {
            myPluginInstallations = new JetHashSet <FileSystemPath>();

            myLifetime            = lifetime;
            myLogger              = logger;
            mySolution            = solution;
            myShellLocks          = shellLocks;
            myDetector            = detector;
            myNotifications       = notifications;
            myApplicationPackages = applicationPackages;
            myApplicationPackagesLocallyInstalled = applicationPackagesLocallyInstalled;
            myPackages = packages;
            myResolver = resolver;

            myBoundSettingsStore = settingsStore.BindToContextLive(myLifetime, ContextRange.Smart(solution.ToDataContext()));
            myQueue = new ProcessingQueue(myShellLocks, myLifetime);
        }
Ejemplo n.º 35
0
 public FindUsagesHandler(Lifetime lifetime, IShellLocks shellLocks, ICommandProcessor commandProcessor, TextControlChangeUnitFactory changeUnitFactory, XXLanguageXXSolution nitraSolution)
 {
   _lifetime = lifetime;
   _shellLocks = shellLocks;
   _commandProcessor = commandProcessor;
   _changeUnitFactory = changeUnitFactory;
   _nitraSolution = nitraSolution;
 }
 public AnimatorScriptUsagesElementContainer([NotNull] IPersistentIndexManager manager,
                                             [NotNull] IShellLocks shellLocks,
                                             [NotNull] MetaFileGuidCache metaFileGuidCache)
 {
     myManager           = manager;
     myShellLocks        = shellLocks;
     myMetaFileGuidCache = metaFileGuidCache;
 }
 public NuGetModuleReferencerImpl(Lifetime lifetime, ITextControlManager textControlManager, IShellLocks shellLocks, ITooltipManager tooltipManager, IActionManager actionManager)
 {
     this.lifetime = lifetime;
     this.textControlManager = textControlManager;
     this.shellLocks = shellLocks;
     this.tooltipManager = tooltipManager;
     this.actionManager = actionManager;
 }
Ejemplo n.º 38
0
 public NTriplesCache(
     Lifetime lifetime,
     IShellLocks shellLocks,
     IPsiConfiguration psiConfiguration,
     IPersistentIndexManager persistentIdIndex)
     : base(lifetime, shellLocks, psiConfiguration, persistentIdIndex)
 {
 }
        public MSpecTestElementsSource(MSpecUnitTestProvider provider, AssemblyExplorer assemblyExplorer, ElementFactories elementFactories, IShellLocks shellLocks)
        {
            this._provider = provider;
            this._assemblyExplorer = assemblyExplorer;
            this._elementFactories = elementFactories;

            _metadataElementsSource = new MetadataElementsSource(Logger.GetLogger(typeof(MSpecTestElementsSource)),
                shellLocks);
        }
 public XunitMetadataExplorer([NotNull] XunitElementFactory factory, IShellLocks shellLocks, IProject project, UnitTestElementConsumer consumer)
 {
     if (factory == null) throw new ArgumentNullException("factory");
     this.project = project;
     this.consumer = consumer;
     this.shellLocks = shellLocks;
     this.factory = factory;
     envoy = ProjectModelElementEnvoy.Create(project);
 }
 public JavaScriptDependentFilesCacheHack(
 Lifetime lifetime, IViewable<ILibraryFiles> libraryFiles,
 JavaScriptDependentFilesModuleFactory dependentFilesModuleFactory,
 JavaScriptDependentFilesBuilder builder, IShellLocks locks,
 IPsiConfiguration configuration, IPersistentIndexManager persistentIndexManager)
     : base(lifetime, new ListEvents<ILibraryFiles>(lifetime, "booo"),
        dependentFilesModuleFactory, builder,
        locks, configuration, persistentIndexManager)
 {
 }
 public SilverlightMsTestMetadataExplorer(IShellLocks shellLocks,
     mstestlegacy::JetBrains.ReSharper.UnitTestProvider.MSTest.MsTestProvider msTestLegacyProvider = null,
     mstestlegacy::JetBrains.ReSharper.UnitTestProvider.MSTest.MsTestElementFactory msTestLegacyElementFactory = null,
     mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest.MsTestProvider msTest10Provider = null,
     mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest.MsTestElementFactory msTest10ElementFactory = null)
 {
     this.shellLocks = shellLocks;
     this.msTestLegacyProvider = msTestLegacyProvider;
     this.msTestLegacyElementFactory = msTestLegacyElementFactory;
     this.msTest10Provider = msTest10Provider;
     this.msTest10ElementFactory = msTest10ElementFactory;
 }
 public SilverlightMsTestMetadataExplorer(IShellLocks shellLocks, ISettingsStore settingsStore, SilverlightUnitTestProvider provider, Lifetime lifetime, ISolution solution, 
     IUnitTestElementManager unitTestElementManager, mstestlegacy::JetBrains.ReSharper.UnitTestProvider.MSTest.IMsTestElementFactory elementFactory, 
     IMainWindow mainWindow, IApplicationDescriptor applicationDescriptor)
 {
     Provider = provider;
     msTestAttributesProvider = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestAttributesProvider();
     var msTestProvider = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestProvider(shellLocks, settingsStore, msTestAttributesProvider, mainWindow, applicationDescriptor);
     var msTestServices = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestServices(lifetime, solution, msTestProvider, settingsStore);
     msTestElementFactory = new mstest10::JetBrains.ReSharper.UnitTestProvider.MSTest10.MsTestElementFactory(msTestServices, unitTestElementManager);
     this.shellLocks = shellLocks;
     this.elementFactory = elementFactory;
 }
Ejemplo n.º 44
0
        public T4PsiModuleProvider([NotNull] Lifetime lifetime, [NotNull] IShellLocks shellLocks, [NotNull] ChangeManager changeManager,
            [NotNull] T4Environment t4Environment, [NotNull] ISolution solution)
        {
            _lifetime = lifetime;
            _shellLocks = shellLocks;
            _changeManager = changeManager;
            _t4Environment = t4Environment;
            _solution = solution;

            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, this, solution);
        }
 public ReflectedReferenceProviderValidator(Lifetime lifetime, IShellLocks shellLocks, ChangeManager changeManager, ISettingsStore settingsStore, ISolution solution)
 {
     var providerValidator = this;
     changeManager.Changed2.Advise(lifetime, Handler(solution, providerValidator));
     settingsStore.BindToContextLive(lifetime, ContextRange.Smart(solution.ToDataContext()))
         .GetValueProperty<MvcCustomReferencesSettings, bool>(lifetime, mvcSettings => mvcSettings.Enabled)
         .Change.Advise_NoAcknowledgement(lifetime,
             () =>
             {
                 if (lifetime.IsTerminated)
                     return;
                 shellLocks.ExecuteOrQueueReadLockEx(lifetime, "ReflectedReferenceProviderValidator", () => shellLocks.ExecuteWithWriteLock(providerValidator.FireOnChanged));
             });
 }
Ejemplo n.º 46
0
 protected SilverlightElementsSourceBase(
     SilverlightUnitTestProvider provider,
     IMsTestServices msTestServices,
     IMsTestAttributesProvider msTestAttributesProvider,
     IUnitTestElementManager unitTestElementManager,
     IUnitTestCategoryFactory unitTestCategoryFactory,
     IShellLocks shellLocks)
 {
     this.Provider = provider;
     this.msTestServices = msTestServices;
     this.msTestAttributesProvider = msTestAttributesProvider;
     this.unitTestElementManager = unitTestElementManager;
     this.unitTestCategoryFactory = unitTestCategoryFactory;
     this.shellLocks = shellLocks;
     this.metadataElementsSource = new MetadataElementsSource(Logger.GetLogger(typeof(SilverlightElementsSourceBase)), shellLocks);
 }
 public ExternalCodeFilesProvider(
     IProjectFileExtensions projectFileExtensions,
     PsiProjectFileTypeCoordinator projectFileTypeCoordinator,
     ChangeManager changeManager,
     IFileSystemTracker fileSystemTracker,
     IShellLocks shellLocks,
     DocumentManager documentManager,
     ISettingsStore settingsStore)
 {
     _projectFileExtensions = projectFileExtensions;
     _projectFileTypeCoordinator = projectFileTypeCoordinator;
     _changeManager = changeManager;
     _fileSystemTracker = fileSystemTracker;
     _shellLocks = shellLocks;
     _documentManager = documentManager;
     _settingsStore = settingsStore;
 }
Ejemplo n.º 48
0
		public TestCache(Lifetime lifetime, ISolution solution, IUnitTestingSettingsAccessor settingsAccessor,
			IShellLocks shellLocks, IPsiConfiguration psiConfiguration, ISettingsStore settingsStore,
			KarmaTestProvider testProvider, JasmineElementFactory jasmineFactory,
			IPersistentIndexManager persistentIndexManager, IJavaScriptDependencyManager javaScriptDependencyManager)
		{
			_lifetime = lifetime;
			_solution = solution;
			_settingsAccessor = settingsAccessor;
			_shellLocks = shellLocks;
			_psiConfiguration = psiConfiguration;
			_testProvider = testProvider;
			myJasmineFactory = jasmineFactory;
			_persistentIndexManager = persistentIndexManager;
			_javaScriptDependencyManager = javaScriptDependencyManager;
			_settingsStore = settingsStore.BindToContextLive(lifetime, ContextRange.ManuallyRestrictWritesToOneContext(solution.ToDataContext()), BindToContextFlags.Normal);
			_settingsStore.Changed.Advise(lifetime, OnSettingsChange);
			Active = new Property<bool>(lifetime, "KarmaTestCache", true);
		}
Ejemplo n.º 49
0
 public SettingsUpgrader(ISettingsStore settingsStore, IApplicationDescriptor applicationDescriptor, IShellLocks locks, ProductSettingsLocation productSettingsLocation, RunsProducts.ProductConfigurations productConfigurations)
 {
   var boundSettingsStore = settingsStore.BindToContextTransient(ContextRange.ManuallyRestrictWritesToOneContext((l, contexts) => contexts.Empty));
   Expression<Func<ZenCodingSettings, bool>> isUpgradedProperty = settings => settings.IsUpgraded;
   if (!boundSettingsStore.GetValue(isUpgradedProperty))
   {
     var settingsComponent = new ShellSettingsComponent(applicationDescriptor, locks, productSettingsLocation, productConfigurations);
     var oldSettings = new Settings();
     settingsComponent.LoadSettings(oldSettings, XmlExternalizationScope.UserSettings, oldSettings.GetType().Name);
     for (int i = 0; i < oldSettings.FileAssociations.Count; i++)
     {
       var association = oldSettings.FileAssociations[i];
       boundSettingsStore.SetIndexedValue((ZenCodingSettings settings) => settings.FileAssociations, i, association);
     }
     
     boundSettingsStore.SetValue(isUpgradedProperty, true);
   }
 }
        public ExternalCodeOptionsPage(
            IUIApplication environment,
            OptionsSettingsSmartContext settings,
            Lifetime lifetime,
            IShellLocks shellLocks,
            IWindowsHookManager windowsHookManager,
            FormValidators formValidators,
            IMainWindow mainWindow = null)
            : base(lifetime, environment, Pid)
        {
            _settings = settings;
            _lifetime = lifetime;
            _windowsHookManager = windowsHookManager;
            _formValidators = formValidators;
            _mainWindow = mainWindow;

            InitControls();
            shellLocks.QueueRecurring(lifetime, "Force settings merge", TimeSpan.FromMilliseconds(300.0), () => OnOk());
        }
Ejemplo n.º 51
0
        public NitraSolutionComponent(Lifetime lifetime, ISolution solution, ChangeManager changeManager, DocumentManager documentManager,
            IShellLocks locks, IPsiConfiguration psiConfiguration, IPersistentIndexManager persistentIndexManager)
        {
            _persistentIndexManager = persistentIndexManager;
              _psiConfiguration = psiConfiguration;
              _locks = locks;
              _solution = solution;
              _documentManager = documentManager;
              //changeManager.Changed2.Advise(lifetime, OnChangeManagerChanged);

              changeManager.RegisterChangeProvider(lifetime, this);
              changeManager.AddDependency(lifetime, this, documentManager.ChangeProvider);
              changeManager.AddDependency(lifetime, this, solution);

              foreach (var project in solution.GetAllProjects())
              {
            Debug.WriteLine(project.Name);
            //var projectItem = project as JetBrains.Proj
            foreach (var file in project.GetAllProjectFiles())
            {
              var ext = System.IO.Path.GetExtension(file.Name);
              if (string.Equals(ext, ".dll", StringComparison.InvariantCultureIgnoreCase))
            continue;

              if (file.LanguageType.Name == "MSBuild")
            continue;

              if (string.Equals(ext, ".dsl", StringComparison.InvariantCultureIgnoreCase))
              {
            var stream = file.CreateReadStream();
            string content = "";
            using (var streamReader = new StreamReader(stream))
              content = streamReader.ReadToEnd();
            Debug.WriteLine(content);
              }

              Debug.WriteLine(file.Name);
            }

              }
        }
 public UseIntConstantsInsteadOfLiterals(IShellLocks shellLocks)
 {
   _shellLocks = shellLocks;
 }
 public RegisteredComponentsContextSearch(SolutionAnalyzer solutionAnalyzer, IShellLocks locks)
 {
     this.locks = locks;
     cachedRegistrations = solutionAnalyzer.Analyze();
 }
Ejemplo n.º 54
0
        internal T4PsiModule([NotNull] Lifetime lifetime, [NotNull] PsiModuleManager psiModuleManager, [NotNull] DocumentManager documentManager,
            [NotNull] ChangeManager changeManager, [NotNull] IAssemblyFactory assemblyFactory, [NotNull] IShellLocks shellLocks,
            [NotNull] IProjectFile projectFile, [NotNull] T4FileDataCache fileDataCache, [NotNull] T4Environment t4Environment,
            [NotNull] OutputAssembliesCache outputAssembliesCache)
        {
            _lifetime = lifetime;
            lifetime.AddAction(Dispose);

            _psiModuleManager = psiModuleManager;
            _documentManager = documentManager;
            _assemblyFactory = assemblyFactory;

            _changeManager = changeManager;
            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, psiModuleManager, this);

            _shellLocks = shellLocks;
            _projectFile = projectFile;
            _project = projectFile.GetProject();
            Assertion.AssertNotNull(_project, "_project != null");
            _solution = _project.GetSolution();

            _t4Environment = t4Environment;
            _outputAssembliesCache = outputAssembliesCache;
            _resolveProject = new T4ResolveProject(_solution, _shellLocks, t4Environment.PlatformID, _project);

            _sourceFile = new PsiProjectFile(
                this,
                _projectFile,
                (pf, sf) => new DefaultPsiProjectFileProperties(pf, sf),
                JetFunc<IProjectFile, IPsiSourceFile>.True,
                _documentManager);

            _isValid = true;
            fileDataCache.FileDataChanged.Advise(lifetime, OnDataFileChanged);
            AddBaseReferences();
        }
 /// <summary>
 /// Initializes a new instance of the StyleCopCodeCleanupModule class.
 /// </summary>
 /// <param name="shellLocks">
 /// The IShellLocks object.
 /// </param>
 public StyleCopCodeCleanupModule(IShellLocks shellLocks)
 {
     this.shellLocks = shellLocks;
 }
 public RegisteredComponentsSearchRequest([NotNull] ISolution solution, [NotNull] IShellLocks locks, IComponentRegistration componentRegistration)
 {
     this.solution = solution;
     this.locks = locks;
     this.componentRegistration = componentRegistration;
 }
Ejemplo n.º 57
0
 public MetadataElementsSource(IShellLocks shellLocks)
     : base(Logger.GetLogger(typeof (MetadataElementsSource)), shellLocks)
 {
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ReadabilityRules"/> class.
 /// </summary>
 /// <param name="shellLocks">
 /// The shell locks.
 /// </param>
 public ReadabilityRules(IShellLocks shellLocks)
 {
     this.shellLocks = shellLocks;
 }
 /// <summary>
 /// Initializes a new instance of the <see cref="ItemOccurenceProvider"/> class.
 /// </summary>
 /// <param name="lifetime">The lifetime.</param>
 /// <param name="taskHost">The task host.</param>
 /// <param name="shellLocks">The shell locks.</param>
 public ItemOccurenceProvider([NotNull] Lifetime lifetime, [NotNull] ITaskHost taskHost, [NotNull] IShellLocks shellLocks)
 {
   this.myLifetime = lifetime;
   this.myTaskHost = taskHost;
   this.myShellLocks = shellLocks;
 }
Ejemplo n.º 60
0
        internal T4PsiModule([NotNull] Lifetime lifetime, [NotNull] IPsiModules psiModules, [NotNull] DocumentManager documentManager,
            [NotNull] ChangeManager changeManager, [NotNull] IAssemblyFactory assemblyFactory, [NotNull] IShellLocks shellLocks,
            [NotNull] IProjectFile projectFile, [NotNull] T4FileDataCache fileDataCache, [NotNull] T4Environment t4Environment,
            [NotNull] OutputAssemblies outputAssemblies)
        {
            _lifetime = lifetime;
            lifetime.AddAction(Dispose);

            _psiModules = psiModules;
            _assemblyFactory = assemblyFactory;
            _changeManager = changeManager;
            _shellLocks = shellLocks;

            _projectFile = projectFile;
            IProject project = projectFile.GetProject();
            Assertion.AssertNotNull(project, "project != null");
            _project = project;
            _solution = project.GetSolution();

            changeManager.RegisterChangeProvider(lifetime, this);
            changeManager.AddDependency(lifetime, psiModules, this);

            _t4Environment = t4Environment;
            _outputAssemblies = outputAssemblies;
            _resolveProject = new T4ResolveProject(lifetime, _solution, _shellLocks, t4Environment.PlatformID, project);

            _sourceFile = CreateSourceFile(projectFile, documentManager);

            _isValid = true;
            fileDataCache.FileDataChanged.Advise(lifetime, OnDataFileChanged);
            AddBaseReferences();
        }