示例#1
0
        public async Task Autocomplete_WithCollectionAndPrefix_GetsFilteredAutocomplete()
        {
            var playground = PlaygroundWorkspace.FromSource(SourceCodeKind.Regular, SampleCode.CompilerTest, 174);

            IEnumerable <string> results;

            using (var autoComplete = new AutoCompleteWorkspaceService(playground))
            {
                results = await GetAutocomplete(autoComplete);
            }

            var expected = new[]
            {
                "Add",
                "AddRange"
            };

            CollectionAssert.AreEqual(expected, results);
        }
示例#2
0
        private async Task <IEnumerable <string> > GetAutocomplete(AutoCompleteWorkspaceService autocomplete)
        {
            var selection = await autocomplete.GetAutoCompleteAsync();

            return(selection.Select(r => r.DisplayText));
        }
示例#3
0
        public Analyser(PlaygroundWorkspace workspace)
        {
            Workspace = workspace;

            _autoComplete = new AutoCompleteWorkspaceService(workspace);
        }