protected override IntellisenseController TryCreateIntellisenseController(ITextView textView, IList <ITextBuffer> subjectBuffers) { AntlrIntellisenseController controller = new AntlrIntellisenseController(textView, this, (AntlrBackgroundParser)BackgroundParserFactoryService.GetBackgroundParser(textView.TextBuffer)); textView.Properties[typeof(AntlrIntellisenseController)] = controller; return(controller); }
public AntlrIntellisenseCommandFilter(IVsTextView textViewAdapter, AntlrIntellisenseController controller) : base(textViewAdapter, controller) { var textView = Controller.Provider.EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); var textBuffer = textView.TextBuffer; _classifier = Controller.Provider.ClassifierAggregatorService.GetClassifier(textView.TextBuffer); _textStructureNavigator = Controller.Provider.TextStructureNavigatorSelectorService.GetTextStructureNavigator(textBuffer); }
public AntlrIntellisenseCommandFilter(IVsTextView textViewAdapter, AntlrIntellisenseController controller) : base(textViewAdapter, controller) { var textView = Controller.Provider.EditorAdaptersFactoryService.GetWpfTextView(textViewAdapter); var textBuffer = textView.TextBuffer; _classifier = Controller.Provider.ClassifierAggregatorService.GetClassifier(textView.TextBuffer); _textStructureNavigator = Controller.Provider.TextStructureNavigatorSelectorService.GetTextStructureNavigator(textBuffer); }
protected override IntellisenseController TryCreateIntellisenseController([NotNull] ITextView textView, [NotNull] IList <ITextBuffer> subjectBuffers) { Requires.NotNull(textView, nameof(textView)); Requires.NotNull(subjectBuffers, nameof(subjectBuffers)); AntlrIntellisenseController controller = new AntlrIntellisenseController(textView, this, (AntlrBackgroundParser)BackgroundParserFactoryService.GetBackgroundParser(textView.TextBuffer)); textView.Properties[typeof(AntlrIntellisenseController)] = controller; return(controller); }
private IEnumerable <Completion> GetContextCompletions(SnapshotPoint triggerPoint, AntlrIntellisenseController controller, ICompletionSession session) { var ruleSpans = BackgroundParser.RuleSpans; if (ruleSpans == null || ruleSpans.Count == 0) { return(EmptyCompletions); } var ruleNames = ruleSpans.Keys.ToArray(); List <Completion> completions = ruleNames.Select(CreateRuleReferenceCompletion).ToList(); return(completions); //// Antlr has the strange property that almost any globally visible token can be used throughout an expression (work out the subtle details later). //Element element; //if (!Provider.IntellisenseCache.TryResolveContext(AntlrIntellisenseCache.AntlrPositionReference.FromSnapshotPoint(triggerPoint), out element)) // return new List<Completion>(); //List<Element> scopedDeclarations = element.GetScopedDeclarations().ToList(); //List<Completion> completions = new List<Completion>(); //foreach (var decl in scopedDeclarations) //{ // if (decl == null) // continue; // Completion completion = decl.CreateCompletion(controller, session); // if (completion != null) // completions.Add(completion); //} //return completions; }
protected override IntellisenseController TryCreateIntellisenseController(ITextView textView, IList<ITextBuffer> subjectBuffers) { AntlrIntellisenseController controller = new AntlrIntellisenseController(textView, this, (AntlrBackgroundParser)BackgroundParserFactoryService.GetBackgroundParser(textView.TextBuffer)); textView.Properties[typeof(AntlrIntellisenseController)] = controller; return controller; }