internal static async Task <Document> SortAndRemoveAsync(Document ad, CancellationToken token)
        {
            var service     = ad.GetLanguageService <IRemoveUnnecessaryImportsService> ();
            var newDocument = await service.RemoveUnnecessaryImportsAsync(ad, token);

            return(await OrganizeImportsCommandHandler.SortUsingsAsync(newDocument, token));
        }
Exemple #2
0
        internal static async Task <Document> SortAndRemoveAsync(Document ad, CancellationToken token)
        {
            var model = await ad.GetSemanticModelAsync(token);

            var root        = model.SyntaxTree.GetRoot(token);
            var newDocument = RemoveUnusedImportsCommandHandler.service.RemoveUnnecessaryImports(ad, model, root, token);

            return(await OrganizeImportsCommandHandler.SortUsingsAsync(newDocument, token));
        }