Пример #1
0
        /// <summary>
        /// Primary entry point for intellisense. This is where intellisense list is getting created.
        /// </summary>
        /// <param name="session">Completion session</param>
        /// <param name="completionSets">Completion sets to populate</param>
        public void AugmentCompletionSession(ICompletionSession session, IList <CompletionSet> completionSets)
        {
            Debug.Assert(EditorShell.IsUIThread);

            IREditorDocument doc = REditorDocument.TryFromTextBuffer(_textBuffer);

            if (doc == null)
            {
                return;
            }

            int position = session.GetTriggerPoint(_textBuffer).GetPosition(_textBuffer.CurrentSnapshot);

            if (!doc.EditorTree.IsReady)
            {
                doc.EditorTree.InvokeWhenReady((o) => {
                    RCompletionController controller = ServiceManager.GetService <RCompletionController>(session.TextView);
                    if (controller != null)
                    {
                        controller.ShowCompletion(autoShownCompletion: true);
                        controller.FilterCompletionSession();
                    }
                }, null, this.GetType(), processNow: true);
            }
            else
            {
                PopulateCompletionList(position, session, completionSets, doc.EditorTree.AstRoot);
            }
        }
Пример #2
0
        private void TreeUpdatedCallback()
        {
            if (_asyncSession == null)
            {
                return;
            }

            RCompletionController controller = ServiceManager.GetService <RCompletionController>(_asyncSession.TextView);

            _asyncSession = null;
            if (controller != null)
            {
                controller.ShowCompletion(autoShownCompletion: true);
                controller.FilterCompletionSession();
            }
        }