Exemple #1
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);
        }
Exemple #2
0
 public bool Navigate(
     ISolution solution,
     PopupWindowContextSource windowContext,
     bool transferFocus,
     TabOptions tabOptions = TabOptions.Default)
 {
     throw new NotImplementedException();
 }
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                             TabOptions tabOptions = TabOptions.Default)
        {
            // this literally takes you to the issue
            Shell.Instance.GetComponent <YouTrackService>().NavigateToIssue(IssueId);

            // soon!
            return(true);
        }
Exemple #4
0
        public void Execute(IDataContext context, [NotNull] DelegateExecute nextExecute)
        {
            _typesFromTextControlService = context.GetComponent <ITypesFromTextControlService>().NotNull();
            _solution                 = context.GetData(ProjectModelDataConstants.SOLUTION).NotNull();
            _textControl              = context.GetData(TextControlDataConstants.TEXT_CONTROL).NotNull();
            _linkedTypesService       = _solution.GetComponent <LinkedTypesService>();
            _popupWindowContextSource = context.GetData(UIDataConstants.PopupWindowContextSource);

            //_executionGroupingEvent.FireIncoming();
            ExecuteProlonged();
        }
        public virtual void OnClick(CodeInsightsHighlighting highlighting, ISolution solution)
        {
            var windowContextSource = new PopupWindowContextSource(lt => new RiderEditorOffsetPopupWindowContext(highlighting.Range.StartOffset.Offset));

            if (highlighting is UnityCodeInsightsHighlighting unityCodeInsightsHighlighting)
            {
                if (unityCodeInsightsHighlighting.MenuItems.Count > 0)
                {
                    myBulbMenu.ShowBulbMenu(unityCodeInsightsHighlighting.MenuItems, windowContextSource);
                }
            }
        }
Exemple #6
0
        public override bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                                      TabOptions tabOptions = TabOptions.Default)
        {
            if (!solution.GetComponent <ConnectionTracker>().IsConnectionEstablished())
            {
                return(base.Navigate(solution, windowContext, transferFocus, tabOptions));
            }

            var findRequestCreator = solution.GetComponent <UnityEditorFindUsageResultCreator>();

            return(findRequestCreator.CreateRequestToUnity(myUnityEventTargetReference, true));
        }
		public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default) {
			if (!IsValid)
				return false;

			FileSystemPath path = _rangeMarker.Document.GetOutsideSolutionPath();
			if (path.IsEmpty)
				return false;

			var navigationInfo = new T4OutsideSolutionNavigationInfo(path, _rangeMarker.Range, transferFocus, tabOptions);
			var navigationOptions = NavigationOptions.FromWindowContext(windowContext, "Navigate to included file", transferFocus, tabOptions);
			var navigationManager = NavigationManager.GetInstance(solution);
			return navigationManager.Navigate<T4OutsideSolutionNavigationProvider, T4OutsideSolutionNavigationInfo>(navigationInfo, navigationOptions);
		}
        public override bool Navigate([NotNull] ISolution solution,
                                      [NotNull] PopupWindowContextSource windowContext,
                                      bool transferFocus,
                                      TabOptions tabOptions = TabOptions.Default)
        {
            if (DeclaredElementPointer is null)
            {
                return(true);
            }
            var navigator = solution.GetComponent <UnityAssetOccurrenceNavigator>();

            return(navigator.Navigate(solution, DeclaredElementPointer, OwningElementLocation));
        }
Exemple #9
0
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                             TabOptions tabOptions = TabOptions.Default)
        {
            var psiFile = mySourceFile.GetPrimaryPsiFile();

            if (psiFile == null || !psiFile.Language.Is <JsonLanguage>())
            {
                return(false);
            }

            var range = TextRange.FromLength(myNavigationTreeOffset, myName.Length);

            return(mySourceFile.Navigate(range, transferFocus, tabOptions, windowContext));
        }
        public void OnClick(CodeInsightsHighlighting highlighting, ISolution solution)
        {
            var windowContextSource = new PopupWindowContextSource(
                lt => new HostTextControlPopupWindowContext(lt,
                                                            highlighting.DeclaredElement.GetSolution().GetComponent <TextControlManager>().LastFocusedTextControl
                                                            .Value).MarkAsOriginatedFromDataContext());

            if (highlighting is UnityCodeInsightsHighlighting unityCodeInsightsHighlighting)
            {
                if (unityCodeInsightsHighlighting.MenuItems.Count > 0)
                {
                    myBulbMenu.ShowBulbMenu(unityCodeInsightsHighlighting.MenuItems, windowContextSource);
                }
            }
        }
        public override bool Navigate(
            ISolution solution,
            PopupWindowContextSource windowContext,
            bool transferFocus,
            TabOptions tabOptions = TabOptions.Default)
        {
            var textControlManager = solution.GetComponent <ITextControlManager>();

            var declaredElement = OccurrenceElement.NotNull().GetValidDeclaredElement();

            if (declaredElement == null)
            {
                return(false);
            }

            foreach (var declaration in declaredElement.GetDeclarations())
            {
                var sourceFile = declaration.GetSourceFile();
                if (sourceFile == null)
                {
                    continue;
                }

                foreach (var textControl in textControlManager.TextControls)
                {
                    if (textControl.Document != sourceFile.Document)
                    {
                        continue;
                    }

                    var declarationRange  = declaration.GetDocumentRange();
                    var textControlOffset = textControl.Caret.DocumentOffset();
                    if (!declarationRange.Contains(textControlOffset))
                    {
                        continue;
                    }

                    var popupWindowContextSource = solution.GetComponent <IMainWindowPopupWindowContext>().Source;
                    return(sourceFile.Navigate(
                               textControl.Selection.OneDocRangeWithCaret(),
                               transferFocus,
                               tabOptions,
                               popupWindowContextSource));
                }
            }

            return(base.Navigate(solution, windowContext, transferFocus, tabOptions));
        }
        public override bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                                      TabOptions tabOptions = TabOptions.Default)
        {
            using (ReadLockCookie.Create())
            {
                solution.GetPsiServices().Files.AssertAllDocumentAreCommitted();
                var declaredElement = DeclaredElementPointer.FindDeclaredElement();

                if (declaredElement != null)
                {
                    declaredElement.Navigate(transferFocus, windowContext, null, tabOptions);
                    return(true);
                }

                return(false);
            }
        }
Exemple #13
0
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default)
        {
            if (!IsValid)
            {
                return(false);
            }

            FileSystemPath path = _rangeMarker.Document.GetOutsideSolutionPath();

            if (path.IsEmpty)
            {
                return(false);
            }

            var navigationInfo = new T4OutsideSolutionNavigationInfo(path, _rangeMarker.Range, transferFocus, tabOptions);
            NavigationOptions navigationOptions = NavigationOptions.FromWindowContext(windowContext, "Navigate to included file", transferFocus, tabOptions);

            return(NavigationManager.GetInstance(solution).Navigate(navigationInfo, navigationOptions));
        }
Exemple #14
0
 public override bool Navigate(TreeModelNode node, PopupWindowContextSource popupWindowContextSource, bool transferFocus)
 {
     // Let the base take a crack at navigating.
     if (base.Navigate(node, popupWindowContextSource, transferFocus))
     {
         return(true);
     }
     else
     {
         if (node != null && node.DataValue is IBlock)
         {
             IBlock block = (IBlock)node.DataValue;
             if (block.Range != null)
             {
                 using (ReadLockCookie.Create())
                 {
                     JetBrains.ReSharper.Feature.Services.Navigation.NavigationManager.Navigate(
                         (DocumentRange)block.Range, this.Solution, transferFocus);
                 }
             }
         }
     }
     return(false);
 }
Exemple #15
0
 public void ExecuteNavigation(PopupWindowContextSource popupWindowContextSource)
 {
 }
        public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
      TabOptions tabOptions = TabOptions.Default)
        {
            // this literally takes you to the issue
              Shell.Instance.GetComponent<YouTrackService>().NavigateToIssue(IssueId);

              // soon!
              return true;
        }
Exemple #17
0
 public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                      TabOptions tabOptions = TabOptions.Default)
 {
     return(myAssetOccurrence.Navigate(solution, windowContext, transferFocus, tabOptions));
 }
    /// <summary>
    /// Navigates the specified solution.
    /// </summary>
    /// <param name="solution">The solution.</param>
    /// <param name="windowContext">The window context.</param>
    /// <param name="transferFocus">if set to <c>true</c> [transfer focus].</param>
    /// <param name="tabOptions">The tab options.</param>
    /// <returns><c>true</c> if XXXX, <c>false</c> otherwise.</returns>
    public bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus, TabOptions tabOptions = TabOptions.Default)
    {
      AppHost.CurrentContentTree.Activate();
      AppHost.CurrentContentTree.Locate(this.ItemUri);

      return true;
    }
Exemple #19
0
 public virtual bool Navigate(ISolution solution, PopupWindowContextSource windowContext, bool transferFocus,
                              TabOptions tabOptions = TabOptions.Default)
 {
     return(solution.GetComponent <UnityAssetOccurrenceNavigator>().Navigate(solution, DeclaredElementPointer, OwningElementLocation));
 }
 public override bool Navigate(TreeModelNode node, PopupWindowContextSource popupWindowContextSource, bool transferFocus)
 {
     // Let the base take a crack at navigating.
     if (base.Navigate(node, popupWindowContextSource, transferFocus))
     {
         return true;
     }
     else
     {
         if (node != null && node.DataValue is IBlock)
         {
             IBlock block = (IBlock) node.DataValue;
             if(block.Range != null)
             {
                 using (ReadLockCookie.Create())
                 {
                     JetBrains.ReSharper.Feature.Services.Navigation.NavigationManager.Navigate(
                         (DocumentRange) block.Range, this.Solution, transferFocus);
                 }
             }
         }
     }
     return false;
 }
            private static void Navigate(Declaration decl, ISolution solution, IProject project, PopupWindowContextSource popupWindowContext)
            {
                var nitraSymbolFile   = decl.File;
                var symbolProjectFile = GrtProjectFile(project, decl.File);

                if (symbolProjectFile != null)
                {
                    symbolProjectFile = GrtSolutionFile(solution, decl.File);
                }

                if (symbolProjectFile != null)
                {
                    var r = new ProjectFileTextRange(symbolProjectFile, decl.Name.Span.StartPos, TargetFrameworkId.Default);
                    r.Navigate(popupWindowContext, true);
                    return;
                }
            }
Exemple #22
0
      private static void Navigate(Declaration decl, ISolution solution, IProject project, PopupWindowContextSource popupWindowContext)
      {
        var nitraSymbolFile = decl.File;
        var symbolProjectFile = GrtProjectFile(project, decl.File);

        if (symbolProjectFile != null)
          symbolProjectFile = GrtSolutionFile(solution, decl.File);

        if (symbolProjectFile != null)
        {
          var r = new ProjectFileTextRange(symbolProjectFile, decl.Name.Span.StartPos, TargetFrameworkId.Default);
          r.Navigate(popupWindowContext, true);
          return;
        }
      }