Example #1
0
        private void ShowParameterInfoPopup()
        {
            _parameterInfoLocation = CurrentLocation;

            _evaluatable.Text = _syntaxEditor.Text;

            IntelliPromptParameterInfo infoTip = _syntaxEditor.IntelliPrompt.ParameterInfo;
            int lastSelectedFunction           = infoTip.SelectedIndex;

            infoTip.Info.Clear();

            try
            {
                ICodeAssistanceContextProvider codeAssistanceContextProvider = _evaluatable.GetCodeAssistanceContextProvider();
                IParameterInfoContext          parameterInfoContext          = codeAssistanceContextProvider.ProvideParameterInfoContext(CurrentLocation);
                ParameterInfoAcceptor          acceptor = new ParameterInfoAcceptor(infoTip, parameterInfoContext.ParameterIndex);
                parameterInfoContext.Enumerate(acceptor);

                if (infoTip.Info.Count == 0)
                {
                    infoTip.Hide();
                }
                else
                {
                    infoTip.SelectedIndex = lastSelectedFunction;
                    infoTip.Show(_syntaxEditor.Caret.Offset);
                }
            }
            catch (NQueryException ex)
            {
                ShowErrorQuickInfo(ex);
            }
        }
Example #2
0
 public EnhancedParameterInfoContext([NotNull] IParameterInfoContext context, [NotNull] ColorizerPresenter colorizerPresenter,
                                     [NotNull] IContextBoundSettingsStore settings)
 {
     _context            = context;
     _colorizerPresenter = colorizerPresenter;
     _settings           = settings;
 }
Example #3
0
        public IParameterInfoContext CreateContext(ISolution solution, IDocument document, int caretOffset, int expectedLParenthOffset, char invocationChar,
                                                   IContextBoundSettingsStore contextBoundSettingsStore)
        {
            IParameterInfoContextFactory factory = _csParameterInfoContextFactory.Value;
            IParameterInfoContext        context = factory != null
                                ? factory.CreateContext(solution, document, caretOffset, expectedLParenthOffset, invocationChar, contextBoundSettingsStore)
                                : null;

            return(Enhance(context, solution, contextBoundSettingsStore));
        }
Example #4
0
        private static IParameterInfoContext Enhance([CanBeNull] IParameterInfoContext context, [NotNull] ISolution solution, [NotNull] IContextBoundSettingsStore settings)
        {
            if (!settings.GetValue((ParameterInfoSettings s) => s.Enabled))
            {
                return(context);
            }

            return(context == null
                                ? null
                                : new EnhancedParameterInfoContext(context, solution.GetComponent <ColorizerPresenter>(), settings));
        }
Example #5
0
        public new IParameterInfoContext CreateContext(
            ISolution solution,
            DocumentOffset caretOffset,
            DocumentOffset expectedLParenthOffset,
            char invocationChar,
            IContextBoundSettingsStore settingsStore)
        {
            IParameterInfoContext context = base.CreateContext(solution, caretOffset, expectedLParenthOffset, invocationChar, settingsStore);

            return(Enhance(context, solution, settingsStore));
        }
 public EnhancedTypeArgumentContext(
     IParameterInfoContext context,
     IContextBoundSettingsStore settings,
     HighlighterIdProviderFactory highlighterIdProviderFactory,
     ColorizerPresenter colorizerPresenter)
     : base(context)
 {
     _settings = settings;
     _highlighterIdProviderFactory = highlighterIdProviderFactory;
     _colorizerPresenter           = colorizerPresenter;
 }
 public EnhancedParameterInfoContext(
     [NotNull] IParameterInfoContext context,
     [NotNull] IContextBoundSettingsStore settings,
     [NotNull] HighlighterIdProviderFactory highlighterIdProviderFactory,
     [NotNull] ColorizerPresenter colorizerPresenter)
     : base(context)
 {
     _settings = settings;
     _highlighterIdProviderFactory = highlighterIdProviderFactory;
     _colorizerPresenter           = colorizerPresenter;
 }
        public new IParameterInfoContext CreateContext(
            ISolution solution,
            DocumentOffset caretOffset,
            DocumentOffset expectedLParenthOffset,
            char invocationChar,
            IContextBoundSettingsStore settingsStore)
        {
            IParameterInfoContext context = base.CreateContext(solution, caretOffset, expectedLParenthOffset, invocationChar, settingsStore);

            if (!context.CanEnhance(settingsStore))
            {
                return(context);
            }

            return(new EnhancedTypeArgumentContext(
                       context,
                       settingsStore,
                       solution.GetComponent <HighlighterIdProviderFactory>(),
                       solution.GetComponent <ColorizerPresenter>()));
        }
 public static bool CanEnhance(
     [CanBeNull] this IParameterInfoContext context,
     [NotNull] IContextBoundSettingsStore settings)
 => context != null && settings.GetValue((ParameterInfoSettings s) => s.Enabled);
		public EnhancedParameterInfoContext([NotNull] IParameterInfoContext context, [NotNull] ColorizerPresenter colorizerPresenter,
			[NotNull] IContextBoundSettingsStore settings) {
			_context = context;
			_colorizerPresenter = colorizerPresenter;
			_settings = settings;
		}