Пример #1
0
        public async Task <FixUsingsWorkerResponse> FixUsings(Solution solution, IEnumerable <ICodeActionProvider> codeActionProviders, string path)
        {
            _path    = path;
            solution = await AddMissingUsings(solution, codeActionProviders);

            solution = await RemoveUsings(solution, codeActionProviders);

            solution = await TryAddLinqQuerySyntax(solution);

            var ambiguous = await GetAmbiguousUsings(solution, codeActionProviders);

            var response = new FixUsingsWorkerResponse();

            response.AmbiguousResults = ambiguous;
            response.Solution         = solution;

            return(response);
        }
Пример #2
0
        public async Task <FixUsingsWorkerResponse> FixUsingsAsync(Document document)
        {
            document = await AddMissingUsingsAsync(document);

            document = await RemoveUnnecessaryUsingsAsync(document);

            document = await TryAddLinqQuerySyntaxAsync(document);

            var ambiguous = await GetAmbiguousUsingsAsync(document);

            var response = new FixUsingsWorkerResponse()
            {
                AmbiguousResults = ambiguous,
                Document         = document
            };

            response.AmbiguousResults = ambiguous;
            response.Document         = document;

            return(response);
        }