/// <summary> /// Called when the view is asking for completion items. /// Shows the intellisense popup. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="e">Event data.</param> private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e) { if (intellisense.GenerateGridCompletions(e.Code, e.Offset, tableModel as IModel, true, false, false, false, false)) { intellisense.Show(e.Coordinates.X, e.Coordinates.Y); } }
/// <summary> /// The view is asking for items for its intellisense. /// </summary> /// <param name="sender">Editor that the user is typing in.</param> /// <param name="e">Event Arguments.</param> /// <param name="properties">Whether or not property suggestions should be generated.</param> /// <param name="methods">Whether or not method suggestions should be generated.</param> /// <param name="events">Whether or not event suggestions should be generated.</param> private void GetCompletionOptions(object sender, NeedContextItemsArgs e, bool properties, bool methods, bool events) { try { string currentLine = GetLine(e.Code, e.LineNo - 1); if (intellisense.GenerateGridCompletions(currentLine, e.ColNo, report, properties, methods, events, e.ControlSpace)) { intellisense.Show(e.Coordinates.Item1, e.Coordinates.Item2); } intellisense.ItemSelected += (o, args) => { if (args.ItemSelected == string.Empty) { (sender as IEditorView).InsertAtCaret(args.ItemSelected); } else { (sender as IEditorView).InsertCompletionOption(args.ItemSelected, args.TriggerWord); } }; } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// The view is asking for items for its intellisense. /// </summary> /// <param name="sender">Editor that the user is typing in.</param> /// <param name="e">Event Arguments.</param> /// <param name="rules">Controls whether rules (events) will be shown in intellisense</param> private void GetCompletionOptions(object sender, NeedContextItemsArgs e, bool rules) { try { string currentLine = GetLine(e.Code, e.LineNo - 1); currentEditor = sender as IEditorView; if (!e.ControlShiftSpace && (rules ? intellisense.GenerateGridCompletions(currentLine, e.ColNo, model, true, false, false, false, e.ControlSpace) : intellisense.GenerateGridCompletions(currentLine, e.ColNo, model, false, true, false, true, e.ControlSpace))) { intellisense.Show(e.Coordinates.X, e.Coordinates.Y); } } catch (Exception err) { presenter.MainPresenter.ShowError(err); } }
private void GetContextItems(object o, NeedContextItemsArgs e) { try { if (intellisense.GenerateGridCompletions(e.Code, e.Offset, model, true, false, false, e.ControlSpace)) { intellisense.Show(e.Coordinates.Item1, e.Coordinates.Item2); } } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Invoked when the view is asking for completion options. /// Generates and displays these completion options. /// </summary> /// <param name="sender">Sender object.</param> /// <param name="args">Evenet arguments.</param> private void OnIntellisenseItemsNeeded(object sender, NeedContextItemsArgs args) { try { if (intellisense.GenerateGridCompletions(args.Code, args.Offset, (tableModel as IModel).Children[0], true, false, false, args.ControlSpace)) { intellisense.Show(args.Coordinates.X, args.Coordinates.Y); } } catch (Exception err) { presenter.MainPresenter.ShowError(err); } }
/// <summary> /// The view is asking for items for its intellisense. /// </summary> /// <param name="sender">Editor that the user is typing in.</param> /// <param name="e">Event Arguments.</param> /// <param name="properties">Whether or not property suggestions should be generated.</param> /// <param name="methods">Whether or not method suggestions should be generated.</param> /// <param name="events">Whether or not event suggestions should be generated.</param> private void GetCompletionOptions(object sender, NeedContextItemsArgs e, bool properties, bool methods, bool events) { try { string currentLine = GetLine(e.Code, e.LineNo - 1); currentEditor = sender; if (!e.ControlShiftSpace && intellisense.GenerateGridCompletions(currentLine, e.ColNo, report, properties, methods, events, e.ControlSpace)) { intellisense.Show(e.Coordinates.X, e.Coordinates.Y); } } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
private void GetContextItems(object o, NeedContextItemsArgs e) { try { if (e.ControlShiftSpace) { intellisense.ShowMethodCompletion(model, e.Code, e.Offset, new Point(e.Coordinates.X, e.Coordinates.Y)); } else if (intellisense.GenerateGridCompletions(e.Code, e.Offset, model, true, false, false, e.ControlSpace)) { intellisense.Show(e.Coordinates.X, e.Coordinates.Y); } } catch (Exception err) { presenter.MainPresenter.ShowError(err); } }
/// <summary>User has pressed a '.' in the commands window - supply context items.</summary> /// <param name="sender">Event sender</param> /// <param name="e">Event arguments</param> private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e) { try { if (e.ControlShiftSpace) { intellisense.ShowMethodCompletion(cultivar, e.Code, e.Offset, new Point(e.Coordinates.X, e.Coordinates.Y)); } else if (intellisense.GenerateGridCompletions(e.Code, e.Offset, cultivar, true, false, false, e.ControlSpace)) { intellisense.Show(e.Coordinates.X, e.Coordinates.Y); } } catch (Exception err) { explorerPresenter.MainPresenter.ShowError(err); } }
/// <summary> /// Intellisense lookup. /// </summary> /// <param name="sender">The menu item</param> /// <param name="e">Event arguments</param> private void OnContextItemsNeeded(object sender, NeedContextItemsArgs e) { if (e.ObjectName == string.Empty) { e.ObjectName = "."; } try { string currentLine = GetLine(e.Code, e.LineNo - 1); if (e.ControlShiftSpace) { intellisense.ShowMethodCompletion(factor, e.Code, e.Offset, new Point(e.Coordinates.X, e.Coordinates.Y)); } else if (intellisense.GenerateGridCompletions(currentLine, e.ColNo, factor, true, false, false, false, e.ControlSpace)) { intellisense.Show(e.Coordinates.X, e.Coordinates.Y); } } catch (Exception err) { presenter.MainPresenter.ShowError(err); } }