Example #1
0
        public bool RequestCodeCompletion(string input, int caretOffset)
        {
            if (!_executionQueue.IsEmpty())
            {
                // When execution is ongoing, the completion request is silently ignored to avoid queue congestion.
                // (User would re-enter the TAB key after execution complete.)
                return false;
            }

            _codeCompletionRequest = new CodeCompletionRequest(input, caretOffset);
            _executionQueue.Enqueue(_codeCompletionRequest);

            return true;
        }