Welcome to mirror list, hosted at ThFree Co, Russian Federation.

RemoveUnnecessaryCastCodeFixProvider.RemoveUnnecessaryCastFixAllProvider.cs « RemoveUnnecessaryCast « MonoDevelop.CSharp.CodeFixes « CSharpBinding « addins « src « main - github.com/mono/monodevelop.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: ec7d81839015b3941b9c89f7fceb6006f12de875 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
// Copyright (c) Microsoft.  All Rights Reserved.  Licensed under the Apache License, Version 2.0.  See License.txt in the project root for license information.

using System.Threading;
using System.Threading.Tasks;
using Microsoft.CodeAnalysis.CodeFixes;
using Microsoft.CodeAnalysis.CSharp.Syntax;

namespace MonoDevelop.CSharp.CodeFixes.RemoveUnnecessaryCast
{
	internal partial class RemoveUnnecessaryCastCodeFixProvider : CodeFixProvider
	{
//		private class RemoveUnnecessaryCastFixAllProvider : BatchSimplificationFixAllProvider
//		{
//			internal static new readonly RemoveUnnecessaryCastFixAllProvider Instance = new RemoveUnnecessaryCastFixAllProvider();
//
//			protected override SyntaxNode GetNodeToSimplify(SyntaxNode root, SemanticModel model, Diagnostic diagnostic, Workspace workspace, out string codeActionId, CancellationToken cancellationToken)
//			{
//				codeActionId = null;
//				return GetCastNode(root, model, diagnostic.Location.SourceSpan, cancellationToken);
//			}
//
//			protected override bool NeedsParentFixup
//			{
//				get
//				{
//					return true;
//				}
//			}
//
//			protected override async Task<Document> AddSimplifyAnnotationsAsync(Document document, SyntaxNode nodeToSimplify, CancellationToken cancellationToken)
//			{
//				var cast = nodeToSimplify as CastExpressionSyntax;
//				if (cast == null)
//				{
//					return null;
//				}
//
//				return await RemoveUnnecessaryCastAsync(document, cast, cancellationToken).ConfigureAwait(false);
//			}
//		}
	}
}