Example #1
0
        public async Task SuggestionsTest()
        {
            IEnumerable <string> actual = await ideServices.GetCompletionStringsAsync("using Sys", 9);

            string[] expected = { "System", "Microsoft" };
            CollectionAssert.AreEquivalent(expected, actual);
        }
Example #2
0
        public async Task RequestCompletions(string code, int cursorPosition, int tokenStart)
        {
            await DoCancellableAction(async (token) =>
            {
                var completions = await ideServices.GetCompletionStringsAsync(code, cursorPosition, token);

                // If cancelled, then don't bother sending details back to the client
                token.ThrowIfCancellationRequested();

                Clients.Caller.CompletionsCallback(completions, tokenStart);
            }, Context.ConnectionId, inProgressCompletions);
        }