From 087bc2c4e3adcfe54b5592ca32b984c3be08fbac Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Fri, 1 Apr 2022 16:57:50 +0200 Subject: [PATCH 1/6] Move few 'CodeFixProvider's to Analyzers layer --- .../AddExplicitCastCodeFixProvider.cs | 0 .../AddExplicitCast/ArgumentFixer.cs | 0 .../AddExplicitCast/AttributeArgumentFixer.cs | 0 .../AddInheritdocCodeFixProvider.cs | 14 +++-- ...harpAddObsoleteAttributeCodeFixProvider.cs | 2 +- ...CSharpAliasAmbiguousTypeCodeFixProvider.cs | 0 .../CodeFixes/CSharpCodeFixes.projitems | 21 ++++++- .../CodeFixes/CSharpCodeFixesResources.resx | 37 ++++++++++++ ...DisambiguateSameVariableCodeFixProvider.cs | 6 +- .../CSharpFixReturnTypeCodeFixProvider.cs | 4 +- ...BaseCodeFixProvider.AddNewKeywordAction.cs | 20 +++++-- .../HideBase/HideBaseCodeFixProvider.cs | 0 .../Iterator/CSharpAddYieldCodeFixProvider.cs | 4 +- ...SharpChangeToIEnumerableCodeFixProvider.cs | 4 +- .../CSharpMakeMemberStaticCodeFixProvider.cs | 0 ...akeStatementAsynchronousCodeFixProvider.cs | 6 +- .../CSharpMakeTypeAbstractCodeFixProvider.cs | 0 .../CSharpDeclareAsNullableCodeFixProvider.cs | 4 +- .../CSharpUnsealClassCodeFixProvider.cs | 2 +- ...terpolatedVerbatimStringCodeFixProvider.cs | 4 +- .../CSharpUseLocalFunctionCodeFixProvider.cs | 5 ++ .../xlf/CSharpCodeFixesResources.cs.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.de.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.es.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.fr.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.it.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.ja.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.ko.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.pl.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.pt-BR.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.ru.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.tr.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.zh-Hans.xlf | 60 +++++++++++++++++++ .../xlf/CSharpCodeFixesResources.zh-Hant.xlf | 60 +++++++++++++++++++ .../AddExplicitCast/AddExplicitCastTests.cs | 18 +++--- .../AddExplicitCastTests_FixAllTests.cs | 0 .../Tests/CSharpAnalyzers.UnitTests.projitems | 2 + .../Core/Analyzers/AnalyzersResources.resx | 2 +- .../AbstractAddExplicitCastCodeFixProvider.cs | 27 +++------ .../Core}/CodeFixes/AddExplicitCast/Fixer.cs | 0 .../InheritanceDistanceComparer.cs | 0 ...ractAddObsoleteAttributeCodeFixProvider.cs | 2 +- ...stractAliasAmbiguousTypeCodeFixProvider.cs | 12 ++-- .../Core/CodeFixes/CodeFixes.projitems | 9 +++ .../Core/CodeFixes/CodeFixesResources.resx | 15 +++++ .../AbstractIteratorCodeFixProvider.cs | 0 ...AbstractMakeMemberStaticCodeFixProvider.cs | 4 +- ...AbstractMakeTypeAbstractCodeFixProvider.cs | 4 +- .../AbstractUnsealClassCodeFixProvider.cs | 6 +- .../CodeFixes/xlf/CodeFixesResources.cs.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.de.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.es.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.fr.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.it.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.ja.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.ko.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.pl.xlf | 25 ++++++++ .../xlf/CodeFixesResources.pt-BR.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.ru.xlf | 25 ++++++++ .../CodeFixes/xlf/CodeFixesResources.tr.xlf | 25 ++++++++ .../xlf/CodeFixesResources.zh-Hans.xlf | 25 ++++++++ .../xlf/CodeFixesResources.zh-Hant.xlf | 25 ++++++++ .../AddExplicitCast/ArgumentFixer.vb | 0 ...sualBasicAddExplicitCastCodeFixProvider.vb | 0 ...asicAddObsoleteAttributeCodeFixProvider.vb | 2 +- ...lBasicAliasAmbiguousTypeCodeFixProvider.vb | 0 ...VisualBasicChangeToYieldCodeFixProvider.vb | 4 +- ...alBasicConvertToIteratorCodeFixProvider.vb | 6 +- ...ualBasicMakeTypeAbstractCodeFixProvider.vb | 0 .../VisualBasicUnsealClassCodeFixProvider.vb | 2 +- .../CodeFixes/VisualBasicCodeFixes.projitems | 8 +++ .../VisualBasicCodeFixesResources.resx | 12 ++++ .../xlf/VisualBasicCodeFixesResources.cs.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.de.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.es.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.fr.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.it.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.ja.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.ko.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.pl.xlf | 20 +++++++ .../VisualBasicCodeFixesResources.pt-BR.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.ru.xlf | 20 +++++++ .../xlf/VisualBasicCodeFixesResources.tr.xlf | 20 +++++++ .../VisualBasicCodeFixesResources.zh-Hans.xlf | 20 +++++++ .../VisualBasicCodeFixesResources.zh-Hant.xlf | 20 +++++++ .../AddExplicitCast/AddExplicitCastTests.vb | 14 ++--- .../AddExplicitCastTests_FixAllTests.vb | 0 .../VisualBasicAnalyzers.UnitTests.projitems | 2 + .../Portable/CSharpFeaturesResources.resx | 35 ++--------- .../xlf/CSharpFeaturesResources.cs.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.de.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.es.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.fr.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.it.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.ja.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.ko.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.pl.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.pt-BR.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.ru.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.tr.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.zh-Hans.xlf | 47 +-------------- .../xlf/CSharpFeaturesResources.zh-Hant.xlf | 47 +-------------- .../Core/Portable/FeaturesResources.resx | 23 +------ ...ctImplementAbstractClassCodeFixProvider.cs | 2 +- .../AbstractUseAutoPropertyCodeFixProvider.cs | 10 +++- .../Portable/xlf/FeaturesResources.cs.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.de.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.es.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.fr.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.it.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.ja.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.ko.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.pl.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.pt-BR.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.ru.xlf | 35 ----------- .../Portable/xlf/FeaturesResources.tr.xlf | 35 ----------- .../xlf/FeaturesResources.zh-Hans.xlf | 35 ----------- .../xlf/FeaturesResources.zh-Hant.xlf | 35 ----------- .../Portable/VBFeaturesResources.resx | 12 ---- .../Portable/xlf/VBFeaturesResources.cs.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.de.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.es.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.fr.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.it.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.ja.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.ko.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.pl.xlf | 20 ------- .../xlf/VBFeaturesResources.pt-BR.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.ru.xlf | 20 ------- .../Portable/xlf/VBFeaturesResources.tr.xlf | 20 ------- .../xlf/VBFeaturesResources.zh-Hans.xlf | 20 ------- .../xlf/VBFeaturesResources.zh-Hant.xlf | 20 ------- .../Shared/Extensions/IListExtensions.cs | 29 --------- .../Extensions/IMethodSymbolExtensions.cs | 21 ------- .../Shared/Extensions/ISymbolExtensions.cs | 11 ---- .../Shared/Extensions/SourceTextExtensions.cs | 18 ------ .../Core/Portable/WorkspacesResources.resx | 33 ---------- .../Portable/xlf/WorkspacesResources.cs.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.de.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.es.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.fr.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.it.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.ja.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.ko.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.pl.xlf | 55 ----------------- .../xlf/WorkspacesResources.pt-BR.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.ru.xlf | 55 ----------------- .../Portable/xlf/WorkspacesResources.tr.xlf | 55 ----------------- .../xlf/WorkspacesResources.zh-Hans.xlf | 55 ----------------- .../xlf/WorkspacesResources.zh-Hant.xlf | 55 ----------------- .../Extensions/IMethodSymbolExtensions.cs | 23 +++++++ .../Core/Extensions/ISymbolExtensions.cs | 17 ++++++ .../Core/Extensions/ListExtensions.cs | 16 +++++ ...ourceTextExtensions_SharedWithCodeStyle.cs | 19 ++++++ .../CSharpWorkspaceExtensions.projitems | 25 ++++++++ .../CodeGeneration/ArgumentGenerator.cs | 0 .../CodeGeneration/AttributeGenerator.cs | 0 .../CSharpCodeGenerationHelpers.cs | 0 .../CSharpCodeGenerationOptions.cs | 0 .../CSharpCodeGenerationPreferences.cs | 7 ++- .../CSharpCodeGenerationService.cs | 7 ++- .../CSharpCodeGenerationServiceFactory.cs | 0 .../CSharpDeclarationComparer.cs | 0 .../CSharpFlagsEnumGenerator.cs | 0 .../CodeGeneration/CSharpSyntaxGenerator.cs | 0 .../CodeGeneration/ConstructorGenerator.cs | 0 .../CodeGeneration/ConversionGenerator.cs | 0 .../CodeGeneration/DestructorGenerator.cs | 0 .../CodeGeneration/EnumMemberGenerator.cs | 0 .../CSharp}/CodeGeneration/EventGenerator.cs | 0 .../CodeGeneration/ExpressionGenerator.cs | 0 .../CSharp}/CodeGeneration/FieldGenerator.cs | 0 .../CSharp}/CodeGeneration/MethodGenerator.cs | 0 .../CodeGeneration/NamedTypeGenerator.cs | 0 .../CodeGeneration/NamespaceGenerator.cs | 0 .../CodeGeneration/OperatorGenerator.cs | 0 .../CodeGeneration/ParameterGenerator.cs | 0 .../CodeGeneration/PropertyGenerator.cs | 0 .../CodeGeneration/StatementGenerator.cs | 0 .../CodeGeneration/TypeParameterGenerator.cs | 0 .../CSharpAddImportsService.cs | 11 +++- .../AbstractCodeGenerationService.cs | 32 ++++++---- ...ctCodeGenerationService_FindDeclaration.cs | 2 +- .../AbstractFlagsEnumGenerator.cs | 0 .../CodeGeneration/CodeGenerationContext.cs | 2 +- .../CodeGenerationDestination.cs | 0 .../CodeGeneration/CodeGenerationHelpers.cs | 4 +- .../CodeGenerationOperatorKind.cs | 0 .../CodeGeneration/CodeGenerationOptions.cs | 0 .../CodeGenerationPreferences.cs | 10 +++- .../CodeGenerationSymbolFactory.cs | 11 +++- .../Core}/CodeGeneration/CodeGenerator.cs | 0 .../CodeGeneration/ICodeGenerationService.cs | 8 ++- .../INamedTypeSymbolExtensions.cs | 0 .../Core/CodeGeneration}/ITypeGenerator.cs | 0 .../CodeGeneration/LiteralSpecialValues.cs | 0 .../NullableSyntaxAnnotation.cs | 0 .../CodeGenerationAbstractMethodSymbol.cs | 5 ++ .../CodeGenerationAbstractNamedTypeSymbol.cs | 5 ++ .../Symbols/CodeGenerationArrayTypeSymbol.cs | 0 .../Symbols/CodeGenerationAttributeData.cs | 0 .../CodeGenerationConstructedMethodSymbol.cs | 0 ...odeGenerationConstructedNamedTypeSymbol.cs | 0 .../Symbols/CodeGenerationConstructorInfo.cs | 0 .../CodeGenerationConstructorSymbol.cs | 5 ++ .../Symbols/CodeGenerationConversionSymbol.cs | 5 ++ .../Symbols/CodeGenerationDestructorInfo.cs | 0 .../Symbols/CodeGenerationDestructorSymbol.cs | 0 .../Symbols/CodeGenerationEventInfo.cs | 0 .../Symbols/CodeGenerationEventSymbol.cs | 5 ++ .../Symbols/CodeGenerationFieldInfo.cs | 0 .../Symbols/CodeGenerationFieldSymbol.cs | 5 ++ .../Symbols/CodeGenerationMethodInfo.cs | 0 .../Symbols/CodeGenerationMethodSymbol.cs | 5 ++ .../Symbols/CodeGenerationNamedTypeSymbol.cs | 7 ++- .../Symbols/CodeGenerationNamespaceInfo.cs | 0 .../CodeGenerationNamespaceOrTypeSymbol.cs | 5 ++ .../Symbols/CodeGenerationNamespaceSymbol.cs | 0 .../Symbols/CodeGenerationOperatorSymbol.cs | 7 ++- .../Symbols/CodeGenerationParameterSymbol.cs | 5 ++ .../CodeGenerationPointerTypeSymbol.cs | 0 .../Symbols/CodeGenerationPropertyInfo.cs | 0 .../Symbols/CodeGenerationPropertySymbol.cs | 5 ++ .../Symbols/CodeGenerationSymbol.cs | 27 ++++++++- .../CodeGenerationTypeParameterSymbol.cs | 0 .../Symbols/CodeGenerationTypeSymbol.cs | 5 ++ .../SyntaxAnnotationExtensions.cs | 18 ------ .../Core}/CodeGeneration/TypeGenerator.cs | 0 .../Core}/Extensions/ArrayExtensions.cs | 0 .../Core/Extensions/DocumentExtensions.cs | 6 ++ .../AddImports/AbstractAddImportsService.cs | 10 +++- .../AddImports/IAddImportsService.cs | 23 +++++-- ...AbstractGeneratedCodeRecognitionService.cs | 2 +- .../IGeneratedCodeRecognitionService.cs | 2 + .../ImportAdder}/ImportAdderService.cs | 0 .../Core/WorkspaceExtensions.projitems | 48 +++++++++++++++ .../Core/WorkspaceExtensionsResources.resx | 33 ++++++++++ .../xlf/WorkspaceExtensionsResources.cs.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.de.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.es.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.fr.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.it.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.ja.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.ko.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.pl.xlf | 55 +++++++++++++++++ .../WorkspaceExtensionsResources.pt-BR.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.ru.xlf | 55 +++++++++++++++++ .../xlf/WorkspaceExtensionsResources.tr.xlf | 55 +++++++++++++++++ .../WorkspaceExtensionsResources.zh-Hans.xlf | 55 +++++++++++++++++ .../WorkspaceExtensionsResources.zh-Hant.xlf | 55 +++++++++++++++++ .../VisualBasicAddImportsService.vb | 11 +++- 251 files changed, 2691 insertions(+), 2351 deletions(-) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/AddExplicitCast/AddExplicitCastCodeFixProvider.cs (100%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/AddExplicitCast/ArgumentFixer.cs (100%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/AddExplicitCast/AttributeArgumentFixer.cs (100%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs (91%) rename src/{Features/CSharp/Portable => Analyzers/CSharp/CodeFixes}/AddObsoleteAttribute/CSharpAddObsoleteAttributeCodeFixProvider.cs (94%) rename src/{Features/CSharp/Portable => Analyzers/CSharp/CodeFixes}/AliasAmbiguousType/CSharpAliasAmbiguousTypeCodeFixProvider.cs (100%) rename src/{Features/CSharp/Portable => Analyzers/CSharp/CodeFixes}/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs (97%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs (96%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/HideBase/HideBaseCodeFixProvider.AddNewKeywordAction.cs (82%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/HideBase/HideBaseCodeFixProvider.cs (100%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs (97%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/Iterator/CSharpChangeToIEnumerableCodeFixProvider.cs (97%) rename src/{Features/CSharp/Portable => Analyzers/CSharp/CodeFixes}/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs (100%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs (96%) rename src/{Features/CSharp/Portable => Analyzers/CSharp/CodeFixes}/MakeTypeAbstract/CSharpMakeTypeAbstractCodeFixProvider.cs (100%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs (99%) rename src/{Features/CSharp/Portable => Analyzers/CSharp/CodeFixes}/UnsealClass/CSharpUnsealClassCodeFixProvider.cs (93%) rename src/{Features/CSharp/Portable => Analyzers/CSharp}/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs (93%) rename src/{Features/CSharp/Portable => Analyzers/CSharp/CodeFixes}/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs (99%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/AddExplicitCast/AddExplicitCastTests.cs (98%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/AddExplicitCast/AddExplicitCastTests_FixAllTests.cs (100%) rename src/{Features/Core/Portable => Analyzers/Core}/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs (89%) rename src/{Features/Core/Portable => Analyzers/Core}/CodeFixes/AddExplicitCast/Fixer.cs (100%) rename src/{Features/Core/Portable => Analyzers/Core}/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs (100%) rename src/{Features/Core/Portable => Analyzers/Core/CodeFixes}/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs (98%) rename src/{Features/Core/Portable => Analyzers/Core/CodeFixes}/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs (89%) rename src/{Features/Core/Portable => Analyzers/Core}/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs (100%) rename src/{Features/Core/Portable => Analyzers/Core/CodeFixes}/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs (91%) rename src/{Features/Core/Portable/MakeClassAbstract => Analyzers/Core/CodeFixes/MakeTypeAbstract}/AbstractMakeTypeAbstractCodeFixProvider.cs (92%) rename src/{Features/Core/Portable => Analyzers/Core/CodeFixes}/UnsealClass/AbstractUnsealClassCodeFixProvider.cs (94%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic}/CodeFixes/AddExplicitCast/ArgumentFixer.vb (100%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic}/CodeFixes/AddExplicitCast/VisualBasicAddExplicitCastCodeFixProvider.vb (100%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic/CodeFixes}/AddObsoleteAttribute/VisualBasicAddObsoleteAttributeCodeFixProvider.vb (92%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic/CodeFixes}/AliasAmbiguousType/VisualBasicAliasAmbiguousTypeCodeFixProvider.vb (100%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic}/CodeFixes/Iterator/VisualBasicChangeToYieldCodeFixProvider.vb (90%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic}/CodeFixes/Iterator/VisualBasicConvertToIteratorCodeFixProvider.vb (95%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic/CodeFixes}/MakeTypeAbstract/VisualBasicMakeTypeAbstractCodeFixProvider.vb (100%) rename src/{Features/VisualBasic/Portable => Analyzers/VisualBasic/CodeFixes}/UnsealClass/VisualBasicUnsealClassCodeFixProvider.vb (96%) rename src/{EditorFeatures/VisualBasicTest/Diagnostics => Analyzers/VisualBasic/Tests}/AddExplicitCast/AddExplicitCastTests.vb (99%) rename src/{EditorFeatures/VisualBasicTest/Diagnostics => Analyzers/VisualBasic/Tests}/AddExplicitCast/AddExplicitCastTests_FixAllTests.vb (100%) delete mode 100644 src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/ArgumentGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/AttributeGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpCodeGenerationHelpers.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpCodeGenerationOptions.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpCodeGenerationPreferences.cs (95%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpCodeGenerationService.cs (99%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpCodeGenerationServiceFactory.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpDeclarationComparer.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpFlagsEnumGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/CSharpSyntaxGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/ConstructorGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/ConversionGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/DestructorGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/EnumMemberGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/EventGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/ExpressionGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/FieldGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/MethodGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/NamedTypeGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/NamespaceGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/OperatorGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/ParameterGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/PropertyGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/StatementGenerator.cs (100%) rename src/Workspaces/{CSharp/Portable => SharedUtilitiesAndExtensions/Workspace/CSharp}/CodeGeneration/TypeParameterGenerator.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/AbstractCodeGenerationService.cs (95%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs (99%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/AbstractFlagsEnumGenerator.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/CodeGenerationContext.cs (99%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/CodeGenerationDestination.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/CodeGenerationHelpers.cs (99%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/CodeGenerationOperatorKind.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/CodeGenerationOptions.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/CodeGenerationSymbolFactory.cs (99%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/CodeGenerator.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/ICodeGenerationService.cs (98%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/INamedTypeSymbolExtensions.cs (100%) rename src/Workspaces/{Core/Portable/Shared/Extensions => SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration}/ITypeGenerator.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/LiteralSpecialValues.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/NullableSyntaxAnnotation.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs (98%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs (98%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationAttributeData.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs (96%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs (95%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationEventInfo.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs (97%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs (97%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs (98%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs (98%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs (95%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs (98%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs (97%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs (97%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationSymbol.cs (88%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs (100%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs (98%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/SyntaxAnnotationExtensions.cs (52%) rename src/Workspaces/{Core/Portable => SharedUtilitiesAndExtensions/Workspace/Core}/CodeGeneration/TypeGenerator.cs (100%) rename src/Workspaces/{Core/Portable/Shared => SharedUtilitiesAndExtensions/Workspace/Core}/Extensions/ArrayExtensions.cs (100%) rename src/Workspaces/{Core/Portable/Editing => SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/ImportAdder}/ImportAdderService.cs (100%) diff --git a/src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/AddExplicitCastCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/AddExplicitCast/AddExplicitCastCodeFixProvider.cs similarity index 100% rename from src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/AddExplicitCastCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/AddExplicitCast/AddExplicitCastCodeFixProvider.cs diff --git a/src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/ArgumentFixer.cs b/src/Analyzers/CSharp/CodeFixes/AddExplicitCast/ArgumentFixer.cs similarity index 100% rename from src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/ArgumentFixer.cs rename to src/Analyzers/CSharp/CodeFixes/AddExplicitCast/ArgumentFixer.cs diff --git a/src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/AttributeArgumentFixer.cs b/src/Analyzers/CSharp/CodeFixes/AddExplicitCast/AttributeArgumentFixer.cs similarity index 100% rename from src/Features/CSharp/Portable/CodeFixes/AddExplicitCast/AttributeArgumentFixer.cs rename to src/Analyzers/CSharp/CodeFixes/AddExplicitCast/AttributeArgumentFixer.cs diff --git a/src/Features/CSharp/Portable/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs similarity index 91% rename from src/Features/CSharp/Portable/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs index a400321dc60b8..71054f95f8ead 100644 --- a/src/Features/CSharp/Portable/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/AddInheritdoc/AddInheritdocCodeFixProvider.cs @@ -14,6 +14,7 @@ using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; using Microsoft.CodeAnalysis.CSharp.Syntax; +using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Formatting; using Microsoft.CodeAnalysis.Host.Mef; @@ -80,7 +81,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) if (symbol.IsOverride || symbol.ImplicitInterfaceImplementations().Any()) { - context.RegisterCodeFix(new MyCodeAction(FeaturesResources.Explicitly_inherit_documentation, + context.RegisterCodeFix(new MyCodeAction(CSharpCodeFixesResources.Explicitly_inherit_documentation, c => FixAsync(context.Document, diagnostic, c)), context.Diagnostics); } } @@ -99,7 +100,12 @@ protected override async Task FixAllAsync(Document document, ImmutableArray comment. var xmlSpaceAfterTripleSlash = Token(leading: TriviaList(DocumentationCommentExterior("///")), SyntaxKind.XmlTextLiteralToken, text: " ", valueText: " ", trailing: default); @@ -128,10 +134,10 @@ protected override async Task FixAllAsync(Document document, ImmutableArray> createChangedDocument) - : base(title, createChangedDocument, equivalenceKey: nameof(FeaturesResources.Explicitly_inherit_documentation)) + : base(title, createChangedDocument, equivalenceKey: nameof(CSharpCodeFixesResources.Explicitly_inherit_documentation)) { } } diff --git a/src/Features/CSharp/Portable/AddObsoleteAttribute/CSharpAddObsoleteAttributeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/AddObsoleteAttribute/CSharpAddObsoleteAttributeCodeFixProvider.cs similarity index 94% rename from src/Features/CSharp/Portable/AddObsoleteAttribute/CSharpAddObsoleteAttributeCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/AddObsoleteAttribute/CSharpAddObsoleteAttributeCodeFixProvider.cs index 0bc03fa881700..9725a9d8aaad7 100644 --- a/src/Features/CSharp/Portable/AddObsoleteAttribute/CSharpAddObsoleteAttributeCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/AddObsoleteAttribute/CSharpAddObsoleteAttributeCodeFixProvider.cs @@ -30,7 +30,7 @@ internal class CSharpAddObsoleteAttributeCodeFixProvider [ImportingConstructor] [Obsolete(MefConstruction.ImportingConstructorMessage, error: true)] public CSharpAddObsoleteAttributeCodeFixProvider() - : base(CSharpSyntaxFacts.Instance, CSharpFeaturesResources.Add_Obsolete) + : base(CSharpSyntaxFacts.Instance, CSharpCodeFixesResources.Add_Obsolete) { } } diff --git a/src/Features/CSharp/Portable/AliasAmbiguousType/CSharpAliasAmbiguousTypeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/AliasAmbiguousType/CSharpAliasAmbiguousTypeCodeFixProvider.cs similarity index 100% rename from src/Features/CSharp/Portable/AliasAmbiguousType/CSharpAliasAmbiguousTypeCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/AliasAmbiguousType/CSharpAliasAmbiguousTypeCodeFixProvider.cs diff --git a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems index 33e4b824c2eee..f0c1f8f9d08b0 100644 --- a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems +++ b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems @@ -16,11 +16,30 @@ + + + + + + + + + + + + + + + + + + + @@ -83,4 +102,4 @@ - + \ No newline at end of file diff --git a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixesResources.resx b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixesResources.resx index 54f625de05653..c6227ab8ded87 100644 --- a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixesResources.resx +++ b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixesResources.resx @@ -147,4 +147,41 @@ Fix_record_declaration + + Change return type from {0} to {1} + + + Hide base member + + + Add [Obsolete] + + + Explicitly inherit documentation + + + Unseal class '{0}' + + + Use interpolated verbatim string + + + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + + + Assign to '{0}' + + + Compare to '{0}' + + + Fix return type + + + Replace return with yield return + + + Declare as nullable + \ No newline at end of file diff --git a/src/Features/CSharp/Portable/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs similarity index 97% rename from src/Features/CSharp/Portable/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs index 37eda381c1831..ff841db75313d 100644 --- a/src/Features/CSharp/Portable/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/DisambiguateSameVariable/CSharpDisambiguateSameVariableCodeFixProvider.cs @@ -74,8 +74,8 @@ private static bool CanFix( var node = diagnostic.Location.FindNode(getInnermostNodeForTie: true, cancellationToken); var (left, right, titleFormat) = node switch { - BinaryExpressionSyntax binary => (binary.Left, binary.Right, CSharpFeaturesResources.Compare_to_0), - AssignmentExpressionSyntax assignment => (assignment.Left, assignment.Right, CSharpFeaturesResources.Assign_to_0), + BinaryExpressionSyntax binary => (binary.Left, binary.Right, CSharpCodeFixesResources.Compare_to_0), + AssignmentExpressionSyntax assignment => (assignment.Left, assignment.Right, CSharpCodeFixesResources.Assign_to_0), _ => default, }; @@ -171,7 +171,7 @@ protected override async Task FixAllAsync( } } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(string title, Func> createChangedDocument) : base(title, createChangedDocument, nameof(CSharpDisambiguateSameVariableCodeFixProvider)) diff --git a/src/Features/CSharp/Portable/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs similarity index 96% rename from src/Features/CSharp/Portable/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs index 9a34aa77c5a5a..ea7f816af1c4f 100644 --- a/src/Features/CSharp/Portable/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/FixReturnType/CSharpFixReturnTypeCodeFixProvider.cs @@ -132,10 +132,10 @@ private static (TypeSyntax type, bool useTask) TryGetDeclarationTypeToFix(Syntax } } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(Func> createChangedDocument) - : base(CSharpFeaturesResources.Fix_return_type, createChangedDocument, nameof(CSharpFeaturesResources.Fix_return_type)) + : base(CSharpCodeFixesResources.Fix_return_type, createChangedDocument, nameof(CSharpCodeFixesResources.Fix_return_type)) { } } diff --git a/src/Features/CSharp/Portable/CodeFixes/HideBase/HideBaseCodeFixProvider.AddNewKeywordAction.cs b/src/Analyzers/CSharp/CodeFixes/HideBase/HideBaseCodeFixProvider.AddNewKeywordAction.cs similarity index 82% rename from src/Features/CSharp/Portable/CodeFixes/HideBase/HideBaseCodeFixProvider.AddNewKeywordAction.cs rename to src/Analyzers/CSharp/CodeFixes/HideBase/HideBaseCodeFixProvider.AddNewKeywordAction.cs index b7e5b04f8a007..d63145094df67 100644 --- a/src/Features/CSharp/Portable/CodeFixes/HideBase/HideBaseCodeFixProvider.AddNewKeywordAction.cs +++ b/src/Analyzers/CSharp/CodeFixes/HideBase/HideBaseCodeFixProvider.AddNewKeywordAction.cs @@ -12,6 +12,13 @@ using Microsoft.CodeAnalysis.OrderModifiers; using Roslyn.Utilities; using Microsoft.CodeAnalysis.CSharp.LanguageServices; +using Microsoft.CodeAnalysis.Diagnostics; + +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using Microsoft.CodeAnalysis.Options; +#endif namespace Microsoft.CodeAnalysis.CSharp.CodeFixes.HideBase { @@ -22,7 +29,7 @@ private class AddNewKeywordAction : CodeActions.CodeAction private readonly Document _document; private readonly SyntaxNode _node; - public override string Title => CSharpFeaturesResources.Hide_base_member; + public override string Title => CSharpCodeFixesResources.Hide_base_member; public AddNewKeywordAction(Document document, SyntaxNode node) { @@ -34,19 +41,24 @@ protected override async Task GetChangedDocumentAsync(CancellationToke { var root = await _document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - var newNode = await GetNewNodeAsync(_node, cancellationToken).ConfigureAwait(false); +#if CODE_STYLE + var options = _document.Project.AnalyzerOptions.GetAnalyzerOptionSet(_node.SyntaxTree, cancellationToken); +#else + var options = await _document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); +#endif + + var newNode = GetNewNode(_node, options); var newRoot = root.ReplaceNode(_node, newNode); return _document.WithSyntaxRoot(newRoot); } - private async Task GetNewNodeAsync(SyntaxNode node, CancellationToken cancellationToken) + private static SyntaxNode GetNewNode(SyntaxNode node, OptionSet options) { var syntaxFacts = CSharpSyntaxFacts.Instance; var modifiers = syntaxFacts.GetModifiers(node); var newModifiers = modifiers.Add(SyntaxFactory.Token(SyntaxKind.NewKeyword)); - var options = await _document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); var option = options.GetOption(CSharpCodeStyleOptions.PreferredModifierOrder); if (!CSharpOrderModifiersHelper.Instance.TryGetOrComputePreferredOrder(option.Value, out var preferredOrder) || !AbstractOrderModifiersHelpers.IsOrdered(preferredOrder, modifiers)) diff --git a/src/Features/CSharp/Portable/CodeFixes/HideBase/HideBaseCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/HideBase/HideBaseCodeFixProvider.cs similarity index 100% rename from src/Features/CSharp/Portable/CodeFixes/HideBase/HideBaseCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/HideBase/HideBaseCodeFixProvider.cs diff --git a/src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs similarity index 97% rename from src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs index 0a7ce09afd6ce..a2563be682c9e 100644 --- a/src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/Iterator/CSharpAddYieldCodeFixProvider.cs @@ -220,10 +220,10 @@ protected override bool TryGetNode( return node != null; } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(Document newDocument) - : base(CSharpFeaturesResources.Replace_return_with_yield_return, c => Task.FromResult(newDocument), nameof(CSharpFeaturesResources.Replace_return_with_yield_return)) + : base(CSharpCodeFixesResources.Replace_return_with_yield_return, c => Task.FromResult(newDocument), nameof(CSharpCodeFixesResources.Replace_return_with_yield_return)) { } } diff --git a/src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpChangeToIEnumerableCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/Iterator/CSharpChangeToIEnumerableCodeFixProvider.cs similarity index 97% rename from src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpChangeToIEnumerableCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/Iterator/CSharpChangeToIEnumerableCodeFixProvider.cs index 564d6224c5b4f..3976f1edfcf3a 100644 --- a/src/Features/CSharp/Portable/CodeFixes/Iterator/CSharpChangeToIEnumerableCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/Iterator/CSharpChangeToIEnumerableCodeFixProvider.cs @@ -111,7 +111,7 @@ protected override async Task GetCodeFixAsync(SyntaxNode root, Synta } return new MyCodeAction( - string.Format(CSharpFeaturesResources.Change_return_type_from_0_to_1, + string.Format(CSharpCodeFixesResources.Change_return_type_from_0_to_1, type.ToMinimalDisplayString(model, node.SpanStart), ienumerableGenericSymbol.ToMinimalDisplayString(model, node.SpanStart)), newDocument); } @@ -130,7 +130,7 @@ private static bool TryGetIEnumerableSymbols(SemanticModel model, out INamedType return true; } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(string title, Document newDocument) : base(title, c => Task.FromResult(newDocument), title) diff --git a/src/Features/CSharp/Portable/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs similarity index 100% rename from src/Features/CSharp/Portable/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/MakeMemberStatic/CSharpMakeMemberStaticCodeFixProvider.cs diff --git a/src/Features/CSharp/Portable/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs similarity index 96% rename from src/Features/CSharp/Portable/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs index 5954268d1726a..b760f98b3f513 100644 --- a/src/Features/CSharp/Portable/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixProvider.cs @@ -117,12 +117,12 @@ private static SyntaxNode TryGetStatementToFix(SyntaxNode node) return null; } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(Func> createChangedDocument) - : base(CSharpFeaturesResources.Add_await, + : base(CSharpCodeFixesResources.Add_await, createChangedDocument, - CSharpFeaturesResources.Add_await) + CSharpCodeFixesResources.Add_await) { } } diff --git a/src/Features/CSharp/Portable/MakeTypeAbstract/CSharpMakeTypeAbstractCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/MakeTypeAbstract/CSharpMakeTypeAbstractCodeFixProvider.cs similarity index 100% rename from src/Features/CSharp/Portable/MakeTypeAbstract/CSharpMakeTypeAbstractCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/MakeTypeAbstract/CSharpMakeTypeAbstractCodeFixProvider.cs diff --git a/src/Features/CSharp/Portable/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs similarity index 99% rename from src/Features/CSharp/Portable/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs index a332643629287..de155222a06f4 100644 --- a/src/Features/CSharp/Portable/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/Nullable/CSharpDeclareAsNullableCodeFixProvider.cs @@ -383,10 +383,10 @@ private static bool IsExpressionSupported(SyntaxNode node) SyntaxKind.VariableDeclarator); } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(Func> createChangedDocument, string equivalenceKey) - : base(CSharpFeaturesResources.Declare_as_nullable, + : base(CSharpCodeFixesResources.Declare_as_nullable, createChangedDocument, equivalenceKey) { diff --git a/src/Features/CSharp/Portable/UnsealClass/CSharpUnsealClassCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UnsealClass/CSharpUnsealClassCodeFixProvider.cs similarity index 93% rename from src/Features/CSharp/Portable/UnsealClass/CSharpUnsealClassCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/UnsealClass/CSharpUnsealClassCodeFixProvider.cs index 7f91482a7b1bd..b0592a5065bd6 100644 --- a/src/Features/CSharp/Portable/UnsealClass/CSharpUnsealClassCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UnsealClass/CSharpUnsealClassCodeFixProvider.cs @@ -26,6 +26,6 @@ public CSharpUnsealClassCodeFixProvider() public override ImmutableArray FixableDiagnosticIds { get; } = ImmutableArray.Create(CS0509); - protected override string TitleFormat => CSharpFeaturesResources.Unseal_class_0; + protected override string TitleFormat => CSharpCodeFixesResources.Unseal_class_0; } } diff --git a/src/Features/CSharp/Portable/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs similarity index 93% rename from src/Features/CSharp/Portable/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs index fbeabc2b41b9e..318aada38042b 100644 --- a/src/Features/CSharp/Portable/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseInterpolatedVerbatimString/CSharpUseInterpolatedVerbatimStringCodeFixProvider.cs @@ -77,10 +77,10 @@ private static void AddEdits( editor.ReplaceNode(verbatimInterpolated, interpolatedVerbatim); } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(Func> createChangedDocument) - : base(FeaturesResources.Use_interpolated_verbatim_string, createChangedDocument, nameof(FeaturesResources.Use_interpolated_verbatim_string)) + : base(CSharpCodeFixesResources.Use_interpolated_verbatim_string, createChangedDocument, nameof(CSharpCodeFixesResources.Use_interpolated_verbatim_string)) { } } diff --git a/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs b/src/Analyzers/CSharp/CodeFixes/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs similarity index 99% rename from src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs rename to src/Analyzers/CSharp/CodeFixes/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs index 19dbb99b310eb..87cafd3879c74 100644 --- a/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs +++ b/src/Analyzers/CSharp/CodeFixes/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs @@ -89,7 +89,12 @@ protected override async Task FixAllAsync( var root = editor.OriginalRoot; var currentRoot = root.TrackNodes(nodesToTrack); +#if CODE_STYLE + var options = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(root.SyntaxTree, cancellationToken); +#else var options = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); +#endif + var languageVersion = semanticModel.SyntaxTree.Options.LanguageVersion(); var makeStaticIfPossible = languageVersion >= LanguageVersion.CSharp8 && options.GetOption(CSharpCodeStyleOptions.PreferStaticLocalFunction).Value; diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.cs.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.cs.xlf index b4bd6f97098b0..5b21c414295ac 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.cs.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.cs.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' Přidejte položku this. + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' Převést typeof na nameof + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Předat zachycené proměnné jako argumenty @@ -47,6 +92,21 @@ Odebrat nedosažitelný kód + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Upozornění: Když se do deklarace místní funkce přidají parametry, může to vytvořit neplatný kód. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.de.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.de.xlf index 0d85bfecf1d2f..bb484f8849c05 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.de.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.de.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' "this." hinzufügen + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' "typeof" in "nameof" konvertieren + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Erfasste Variablen als Argumente übergeben @@ -47,6 +92,21 @@ Nicht erreichbaren Code entfernen + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Warnung: Das Hinzufügen von Parametern zur Deklaration einer lokalen Funktion kann zu ungültigem Code führen. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.es.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.es.xlf index 8f24b3d4e4dc5..9ec84cd78b28a 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.es.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.es.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' Agregar "this." + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' Convertir "typeof" en "nameof" + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Pasar variables capturadas como argumentos @@ -47,6 +92,21 @@ Quitar código inaccesible + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Advertencia: Agregar parámetros a la declaración de función local puede generar código no válido. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.fr.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.fr.xlf index 8f1d73924d5be..19330d3b0a98a 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.fr.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.fr.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' Ajouter 'this.' + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' Convertir 'typeof' en 'nameof' + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Passer les variables capturées en tant qu'arguments @@ -47,6 +92,21 @@ Supprimer le code inaccessible + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Avertissement : L'ajout de paramètres à la déclaration de fonction locale peut produire du code non valide. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.it.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.it.xlf index b0da312c5c7f2..cc96c18c15e11 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.it.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.it.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' Aggiungi 'this.' + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' Convertire 'typeof' in 'nameof' + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Passa le variabili catturate come argomenti @@ -47,6 +92,21 @@ Rimuovi il codice non eseguibile + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Avviso: l'aggiunta di parametri alla dichiarazione di funzione locale potrebbe produrre codice non valido. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ja.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ja.xlf index ab333aa152467..826b42be612ce 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ja.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ja.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' this' を追加します。 + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' 'typeof' を 'nameof' に変換します + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments キャプチャした変数を引数として渡す @@ -47,6 +92,21 @@ 到達できないコードを削除します + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. 警告: ローカル関数の宣言にパラメーターを追加すると、無効なコードが生成される可能性があります。 diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ko.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ko.xlf index 3b6d930ce1c96..997f46c279fbd 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ko.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ko.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' this'를 추가합니다. + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' 'typeof'를 'nameof'로 변환 + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments 캡처된 변수를 인수로 전달 @@ -47,6 +92,21 @@ 접근할 수 없는 코드 제거 + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. 경고: 로컬 함수 선언에 매개 변수를 추가할 경우 잘못된 코드가 생성될 수 있습니다. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pl.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pl.xlf index 83dee6c13ad3e..08b8a20f1118f 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pl.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pl.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' Dodaj „this.” + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' Konwertuj element „typeof” na element „nameof” + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Przekaż przechwycone zmienne jako argumenty @@ -47,6 +92,21 @@ Usuń nieosiągalny kod + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Ostrzeżenie: Dodanie parametrów do deklaracji funkcji lokalnej może prowadzić do powstania nieprawidłowego kodu. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pt-BR.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pt-BR.xlf index 81e92c9b10e2e..5cbf71ff65bea 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pt-BR.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.pt-BR.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' Adicionar 'isso.' + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' Converter 'typeof' em 'nameof' + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Passar variáveis capturadas como argumentos @@ -47,6 +92,21 @@ Remover código inacessível + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Aviso: a adição de parâmetros à declaração de função local pode produzir um código inválido. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ru.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ru.xlf index 2dab8e4f8a874..055a397d319f2 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ru.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.ru.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' Добавьте "this". + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' Преобразовать "typeof" в "nameof" + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Передача зафиксированных переменных в качестве аргументов @@ -47,6 +92,21 @@ Удалить недостижимый код + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Предупреждение! Добавление параметров в объявление локальной функции может привести к недопустимому коду. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.tr.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.tr.xlf index a784768adf623..7fb336a75e211 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.tr.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.tr.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' this' ekleyin. + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' 'Typeof' metodunu 'nameof' metoduna dönüştürün + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments Yakalanan değişkenleri bağımsız değişken olarak geçir @@ -47,6 +92,21 @@ Erişilemeyen kodları kaldır + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. Uyarı: Yerel işlev bildirimine parametre eklendiğinde geçersiz kod üretilebilir. diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hans.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hans.xlf index 68faaf57ca381..5fab137a6b777 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hans.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hans.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' 添加 "this." + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' 将 "typeof" 转换为 "nameof" + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments 以参数形式传入捕获的变量 @@ -47,6 +92,21 @@ 删除无法访问的代码 + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. 警告: 将参数添加到本地函数声明可能产生无效的代码。 diff --git a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hant.xlf b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hant.xlf index ae9f4b85d4b63..db682c1597cb0 100644 --- a/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hant.xlf +++ b/src/Analyzers/CSharp/CodeFixes/xlf/CSharpCodeFixesResources.zh-Hant.xlf @@ -2,21 +2,66 @@ + + Add [Obsolete] + Add [Obsolete] + + + + Add 'await' + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + Add 'this.' 新增 'this.' + + Assign to '{0}' + Assign to '{0}' + + + + Change return type from {0} to {1} + Change return type from {0} to {1} + + + + Compare to '{0}' + Compare to '{0}' + + Convert 'typeof' to 'nameof' 將 'typeof' 轉換為 'nameof' + + Declare as nullable + Declare as nullable + + + + Explicitly inherit documentation + Explicitly inherit documentation + + Fix_record_declaration Fix_record_declaration + + Fix return type + Fix return type + + + + Hide base member + Hide base member + + Pass in captured variables as arguments 以引數形式傳入擷取到的變數 @@ -47,6 +92,21 @@ 移除執行不到的程式碼 + + Replace return with yield return + Replace return with yield return + + + + Unseal class '{0}' + Unseal class '{0}' + + + + Use interpolated verbatim string + Use interpolated verbatim string + + Warning: Adding parameters to local function declaration may produce invalid code. 警告: 新增參數到區域函式宣告可能會產生無效的程式碼。 diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/AddExplicitCast/AddExplicitCastTests.cs b/src/Analyzers/CSharp/Tests/AddExplicitCast/AddExplicitCastTests.cs similarity index 98% rename from src/EditorFeatures/CSharpTest/Diagnostics/AddExplicitCast/AddExplicitCastTests.cs rename to src/Analyzers/CSharp/Tests/AddExplicitCast/AddExplicitCastTests.cs index c959df4927171..2799ac663f41a 100644 --- a/src/EditorFeatures/CSharpTest/Diagnostics/AddExplicitCast/AddExplicitCastTests.cs +++ b/src/Analyzers/CSharp/Tests/AddExplicitCast/AddExplicitCastTests.cs @@ -2475,7 +2475,7 @@ public Test(string s, Base b, int i, params object[] list) : this(d : (Derived)b } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_0, index: 0, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived")); var expect_1 = @" @@ -2494,7 +2494,7 @@ public Test(string s, Base b, int i, params object[] list) : this(d : (Derived2) } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_1, index: 1, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived2")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived2")); } [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAddExplicitCast)] @@ -2540,7 +2540,7 @@ public Test(string s, Base b, int i, params object[] list) : this(d : (Derived)b } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_0, index: 0, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived")); var expect_1 = @" @@ -2559,7 +2559,7 @@ public Test(string s, Base b, int i, params object[] list) : this(d : (Derived2) } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_1, index: 1, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived2")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived2")); } @@ -2693,7 +2693,7 @@ void M() } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_0, index: 0, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived")); var expect_1 = @" @@ -2715,7 +2715,7 @@ void M() } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_1, index: 1, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived2")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived2")); } [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAddExplicitCast)] @@ -2772,7 +2772,7 @@ void M() } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_0, index: 0, - title: string.Format(FeaturesResources.Convert_type_to_0, "string")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "string")); var expect_1 = @" @@ -2797,7 +2797,7 @@ void M() } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_1, index: 1, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived")); var expect_2 = @" @@ -2822,7 +2822,7 @@ void M() } }"; await TestInRegularAndScriptAsync(initialMarkup, expect_2, index: 2, - title: string.Format(FeaturesResources.Convert_type_to_0, "Derived2")); + title: string.Format(CodeFixesResources.Convert_type_to_0, "Derived2")); } [Fact, Trait(Traits.Feature, Traits.Features.CodeActionsAddExplicitCast)] diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/AddExplicitCast/AddExplicitCastTests_FixAllTests.cs b/src/Analyzers/CSharp/Tests/AddExplicitCast/AddExplicitCastTests_FixAllTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/AddExplicitCast/AddExplicitCastTests_FixAllTests.cs rename to src/Analyzers/CSharp/Tests/AddExplicitCast/AddExplicitCastTests_FixAllTests.cs diff --git a/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems b/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems index 2aa0e218be626..b40c50a32715d 100644 --- a/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems +++ b/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems @@ -9,6 +9,8 @@ Microsoft.CodeAnalysis.CSharp.Analyzers.UnitTests + + diff --git a/src/Analyzers/Core/Analyzers/AnalyzersResources.resx b/src/Analyzers/Core/Analyzers/AnalyzersResources.resx index d1259d23235ef..a39e2e3a3e5df 100644 --- a/src/Analyzers/Core/Analyzers/AnalyzersResources.resx +++ b/src/Analyzers/Core/Analyzers/AnalyzersResources.resx @@ -352,4 +352,4 @@ Simplify LINQ expression - + \ No newline at end of file diff --git a/src/Features/Core/Portable/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs similarity index 89% rename from src/Features/Core/Portable/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs rename to src/Analyzers/Core/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs index 8b32808fe75a2..dc24abf81f8a9 100644 --- a/src/Features/Core/Portable/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/AddExplicitCast/AbstractAddExplicitCastCodeFixProvider.cs @@ -82,7 +82,7 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) if (potentialConversionTypes.Length == 1) { context.RegisterCodeFix(new MyCodeAction( - FeaturesResources.Add_explicit_cast, + CodeFixesResources.Add_explicit_cast, c => FixAsync(context.Document, context.Diagnostics.First(), c)), context.Diagnostics); return; @@ -100,34 +100,21 @@ public override async Task RegisterCodeFixesAsync(CodeFixContext context) _ => Task.FromResult(document.WithSyntaxRoot(ApplyFix(root, targetNode, conversionType))))); } - ReportTelemetryIfNecessary(potentialConversionTypes); - - context.RegisterCodeFix(new CodeAction.CodeActionWithNestedActions( - FeaturesResources.Add_explicit_cast, +#pragma warning disable RS0005 // Do not use generic 'CodeAction.Create' to create 'CodeAction' + context.RegisterCodeFix(CodeAction.Create( + CodeFixesResources.Add_explicit_cast, actions.ToImmutable(), isInlinable: false), context.Diagnostics); +#pragma warning restore RS0005 // Do not use generic 'CodeAction.Create' to create 'CodeAction' } private static string GetSubItemName(SemanticModel semanticModel, int position, ITypeSymbol conversionType) { return string.Format( - FeaturesResources.Convert_type_to_0, + CodeFixesResources.Convert_type_to_0, conversionType.ToMinimalDisplayString(semanticModel, position)); } - private static void ReportTelemetryIfNecessary(ImmutableArray<(TExpressionSyntax node, ITypeSymbol type)> potentialConversionTypes) - { - if (potentialConversionTypes.Length > MaximumConversionOptions) - { - // If the number of potential conversion types is larger than options we could show, report telemetry - Logger.Log(FunctionId.CodeFixes_AddExplicitCast, - KeyValueLogMessage.Create(m => - { - m["NumberOfCandidates"] = potentialConversionTypes.Length; - })); - } - } - protected ImmutableArray<(TExpressionSyntax, ITypeSymbol)> FilterValidPotentialConversionTypes( SemanticModel semanticModel, ArrayBuilder<(TExpressionSyntax node, ITypeSymbol type)> mutablePotentialConversionTypes) @@ -195,7 +182,7 @@ await editor.ApplyExpressionLevelSemanticEditsAsync( cancellationToken).ConfigureAwait(false); } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(string title, Func> createChangedDocument) : base(title, createChangedDocument, equivalenceKey: title) diff --git a/src/Features/Core/Portable/CodeFixes/AddExplicitCast/Fixer.cs b/src/Analyzers/Core/CodeFixes/AddExplicitCast/Fixer.cs similarity index 100% rename from src/Features/Core/Portable/CodeFixes/AddExplicitCast/Fixer.cs rename to src/Analyzers/Core/CodeFixes/AddExplicitCast/Fixer.cs diff --git a/src/Features/Core/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs b/src/Analyzers/Core/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs similarity index 100% rename from src/Features/Core/Portable/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs rename to src/Analyzers/Core/CodeFixes/AddExplicitCast/InheritanceDistanceComparer.cs diff --git a/src/Features/Core/Portable/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs similarity index 98% rename from src/Features/Core/Portable/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs rename to src/Analyzers/Core/CodeFixes/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs index 3d8a78d4c50c4..b4bd6be309ed4 100644 --- a/src/Features/Core/Portable/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/AddObsoleteAttribute/AbstractAddObsoleteAttributeCodeFixProvider.cs @@ -98,7 +98,7 @@ protected override async Task FixAllAsync( } } - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(string title, Func> createChangedDocument) : base(title, createChangedDocument, title) diff --git a/src/Features/Core/Portable/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs similarity index 89% rename from src/Features/Core/Portable/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs rename to src/Analyzers/Core/CodeFixes/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs index ece6c991a3617..0fce4d443c171 100644 --- a/src/Features/Core/Portable/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/AliasAmbiguousType/AbstractAliasAmbiguousTypeCodeFixProvider.cs @@ -10,11 +10,9 @@ using Microsoft.CodeAnalysis.AddImport; using Microsoft.CodeAnalysis.CodeActions; using Microsoft.CodeAnalysis.CodeFixes; -using Microsoft.CodeAnalysis.CodeGeneration; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.LanguageServices; using Microsoft.CodeAnalysis.Shared.Extensions; -using static Microsoft.CodeAnalysis.CodeActions.CodeAction; namespace Microsoft.CodeAnalysis.AliasAmbiguousType { @@ -44,8 +42,8 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) { var addImportService = document.GetRequiredLanguageService(); var syntaxGenerator = document.GetRequiredLanguageService(); - var codeGenerator = document.GetRequiredLanguageService(); var compilation = semanticModel.Compilation; + var options = await AddImportPlacementOptions.FromDocumentAsync(document, cancellationToken).ConfigureAwait(false); var codeActionsBuilder = ImmutableArray.CreateBuilder(symbolInfo.CandidateSymbols.Length); @@ -61,8 +59,10 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) })); } - var groupingTitle = string.Format(FeaturesResources.Alias_ambiguous_type_0, diagnosticNode.ToString()); - var groupingCodeAction = new CodeActionWithNestedActions(groupingTitle, codeActionsBuilder.ToImmutable(), isInlinable: true); + var groupingTitle = string.Format(CodeFixesResources.Alias_ambiguous_type_0, diagnosticNode.ToString()); +#pragma warning disable RS0005 // Do not use generic 'CodeAction.Create' to create 'CodeAction' + var groupingCodeAction = CodeAction.Create(groupingTitle, codeActionsBuilder.ToImmutable(), isInlinable: true); +#pragma warning restore RS0005 // Do not use generic 'CodeAction.Create' to create 'CodeAction' context.RegisterCodeFix(groupingCodeAction, context.Diagnostics.First()); } } @@ -75,7 +75,7 @@ private static bool SymbolCandidatesContainsSupportedSymbols(SymbolInfo symbolIn symbolInfo.CandidateSymbols.All(symbol => symbol.IsKind(SymbolKind.NamedType) && symbol.GetArity() == 0); - private class MyCodeAction : DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(string title, Func> createChangedDocument) : base(title, createChangedDocument, equivalenceKey: title) diff --git a/src/Analyzers/Core/CodeFixes/CodeFixes.projitems b/src/Analyzers/Core/CodeFixes/CodeFixes.projitems index 971c8d54931eb..fa25f72d257e9 100644 --- a/src/Analyzers/Core/CodeFixes/CodeFixes.projitems +++ b/src/Analyzers/Core/CodeFixes/CodeFixes.projitems @@ -16,10 +16,18 @@ + + + + + + + + @@ -34,6 +42,7 @@ + diff --git a/src/Analyzers/Core/CodeFixes/CodeFixesResources.resx b/src/Analyzers/Core/CodeFixes/CodeFixesResources.resx index 9857123d0b852..3c0e61872ce16 100644 --- a/src/Analyzers/Core/CodeFixes/CodeFixesResources.resx +++ b/src/Analyzers/Core/CodeFixes/CodeFixesResources.resx @@ -153,4 +153,19 @@ Add blank line after block + + Make class 'abstract' + + + Make static + + + Add explicit cast + + + Alias ambiguous type '{0}' + + + Convert type to '{0}' + \ No newline at end of file diff --git a/src/Features/Core/Portable/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs similarity index 100% rename from src/Features/Core/Portable/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs rename to src/Analyzers/Core/CodeFixes/Iterator/AbstractIteratorCodeFixProvider.cs diff --git a/src/Features/Core/Portable/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs similarity index 91% rename from src/Features/Core/Portable/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs rename to src/Analyzers/Core/CodeFixes/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs index 9e1ebb32365e3..0c6e2d1b26f31 100644 --- a/src/Features/Core/Portable/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/MakeMemberStatic/AbstractMakeMemberStaticCodeFixProvider.cs @@ -51,10 +51,10 @@ protected sealed override Task FixAllAsync(Document document, ImmutableArray> createChangedDocument) - : base(FeaturesResources.Make_member_static, createChangedDocument, nameof(AbstractMakeMemberStaticCodeFixProvider)) + : base(CodeFixesResources.Make_member_static, createChangedDocument, nameof(AbstractMakeMemberStaticCodeFixProvider)) { } } diff --git a/src/Features/Core/Portable/MakeClassAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/MakeTypeAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs similarity index 92% rename from src/Features/Core/Portable/MakeClassAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs rename to src/Analyzers/Core/CodeFixes/MakeTypeAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs index 357c93d403cf8..75c8067315b4f 100644 --- a/src/Features/Core/Portable/MakeClassAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/MakeTypeAbstract/AbstractMakeTypeAbstractCodeFixProvider.cs @@ -48,10 +48,10 @@ protected sealed override Task FixAllAsync(Document document, ImmutableArray> createChangedDocument) - : base(FeaturesResources.Make_class_abstract, createChangedDocument, FeaturesResources.Make_class_abstract) + : base(CodeFixesResources.Make_class_abstract, createChangedDocument, CodeFixesResources.Make_class_abstract) { } } diff --git a/src/Features/Core/Portable/UnsealClass/AbstractUnsealClassCodeFixProvider.cs b/src/Analyzers/Core/CodeFixes/UnsealClass/AbstractUnsealClassCodeFixProvider.cs similarity index 94% rename from src/Features/Core/Portable/UnsealClass/AbstractUnsealClassCodeFixProvider.cs rename to src/Analyzers/Core/CodeFixes/UnsealClass/AbstractUnsealClassCodeFixProvider.cs index 15ddf33896e86..d0f0843212cf1 100644 --- a/src/Features/Core/Portable/UnsealClass/AbstractUnsealClassCodeFixProvider.cs +++ b/src/Analyzers/Core/CodeFixes/UnsealClass/AbstractUnsealClassCodeFixProvider.cs @@ -62,8 +62,8 @@ private static async Task UnsealDeclarationsAsync( var document = solution.GetDocument(documentId); var root = await document.GetSyntaxRootAsync(cancellationToken).ConfigureAwait(false); - var generator = SyntaxGenerator.GetGenerator(document); - var editor = new SyntaxEditor(root, generator); + var editor = new SyntaxEditor(root, document.Project.Solution.Workspace.Services); + var generator = editor.Generator; foreach (var syntaxReference in syntaxReferences) { @@ -84,7 +84,7 @@ private static async Task UnsealDeclarationsAsync( return solution; } - private sealed class MyCodeAction : CodeAction.SolutionChangeAction + private sealed class MyCodeAction : CustomCodeActions.SolutionChangeAction { public MyCodeAction(string title, Func> createChangedSolution) : base(title, createChangedSolution, title) diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.cs.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.cs.xlf index f513160bcca78..f1d46eaa8a487 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.cs.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.cs.xlf @@ -17,11 +17,26 @@ Přidat výchozí malá a velká písmena + + Add explicit cast + Add explicit cast + + Add file header Přidat hlavičku souboru + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Opravit porušení názvu: {0} @@ -32,6 +47,16 @@ Opravit všechny výskyty v + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Odebrat nadbytečné prázdné řádky diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.de.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.de.xlf index 6c1c949498e92..7051f2740563b 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.de.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.de.xlf @@ -17,11 +17,26 @@ Standardfall hinzufügen + + Add explicit cast + Add explicit cast + + Add file header Dateiheader hinzufügen + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Namensverletzung beheben: {0} @@ -32,6 +47,16 @@ Alle Vorkommen korrigieren in + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Zusätzliche Leerzeilen entfernen diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.es.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.es.xlf index 116cdf3341129..f469e799bbad0 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.es.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.es.xlf @@ -17,11 +17,26 @@ Agregar caso predeterminado + + Add explicit cast + Add explicit cast + + Add file header Agregar encabezado de archivo + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Corregir infracción de nombre: {0} @@ -32,6 +47,16 @@ Corregir todas las repeticiones de + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Quitar líneas en blanco adicionales diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.fr.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.fr.xlf index 999860c862be7..1b3ce6953fcb4 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.fr.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.fr.xlf @@ -17,11 +17,26 @@ Ajouter une instruction case par défaut + + Add explicit cast + Add explicit cast + + Add file header Ajouter un en-tête de fichier + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Corrigez la violation de nom : {0} @@ -32,6 +47,16 @@ Corriger toutes les occurrences dans + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Supprimer les lignes vides supplémentaires diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.it.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.it.xlf index 285347878befa..6f36a4b5bc264 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.it.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.it.xlf @@ -17,11 +17,26 @@ Aggiungi case predefinito + + Add explicit cast + Add explicit cast + + Add file header Aggiungi intestazione del file + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Correggi violazione del nome: {0} @@ -32,6 +47,16 @@ Correggi tutte le occorrenze in + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Rimuovere le righe vuote aggiuntive diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ja.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ja.xlf index e4ef801ccad9a..195db67931daa 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ja.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ja.xlf @@ -17,11 +17,26 @@ 既定のケースの追加 + + Add explicit cast + Add explicit cast + + Add file header ファイル ヘッダーの追加 + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} 名前の違反を修正します: {0} @@ -32,6 +47,16 @@ 次の場所のすべての出現箇所を修正します + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines 余分な空白行を削除する diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ko.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ko.xlf index e174524f20fe7..c21ec38737e9c 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ko.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ko.xlf @@ -17,11 +17,26 @@ Default Case 추가 + + Add explicit cast + Add explicit cast + + Add file header 파일 헤더 추가 + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} 이름 위반 수정: {0} @@ -32,6 +47,16 @@ 다음 위치에서 모든 발생 수정 + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines 여분의 빈 줄 제거 diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pl.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pl.xlf index 6a4a2b355e4b2..50e53701d06f4 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pl.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pl.xlf @@ -17,11 +17,26 @@ Dodaj przypadek domyślny + + Add explicit cast + Add explicit cast + + Add file header Dodaj nagłówek pliku + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Napraw naruszenie nazwy: {0} @@ -32,6 +47,16 @@ Popraw wszystkie wystąpienia w + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Usuń dodatkowe puste wiersze diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pt-BR.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pt-BR.xlf index 35a026587a205..ce6563944f78f 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pt-BR.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.pt-BR.xlf @@ -17,11 +17,26 @@ Adicionar caso padrão + + Add explicit cast + Add explicit cast + + Add file header Adicionar cabeçalho de arquivo + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Corrigir Violação de Nome: {0} @@ -32,6 +47,16 @@ Corrigir todas as ocorrências em + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Remover as linhas em branco extras diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ru.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ru.xlf index 24244e45814d7..da43079f786d4 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ru.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.ru.xlf @@ -17,11 +17,26 @@ Добавить вариант по умолчанию + + Add explicit cast + Add explicit cast + + Add file header Добавить заголовок файла + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Устраните нарушение имени: {0} @@ -32,6 +47,16 @@ Исправить все случаи в + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Удалите лишние пустые строки diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.tr.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.tr.xlf index bb01059ece2fc..78761eaa4d24f 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.tr.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.tr.xlf @@ -17,11 +17,26 @@ Varsayılan durum ekle + + Add explicit cast + Add explicit cast + + Add file header Dosya üst bilgisi ekle + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} Ad İhlalini Düzelt: {0} @@ -32,6 +47,16 @@ Tüm oluşumları şurada düzelt: + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines Fazladan boş satırları kaldır diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hans.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hans.xlf index 103cd6f3e2692..b06f3de0d2d11 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hans.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hans.xlf @@ -17,11 +17,26 @@ 添加默认事例 + + Add explicit cast + Add explicit cast + + Add file header 添加文件头 + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} 解决名称冲突: {0} @@ -32,6 +47,16 @@ 修复以下对象中的所有实例: + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines 删除多余的空白行 diff --git a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hant.xlf b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hant.xlf index c8e0aaecad5ca..a9ebe5d8148d2 100644 --- a/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hant.xlf +++ b/src/Analyzers/Core/CodeFixes/xlf/CodeFixesResources.zh-Hant.xlf @@ -17,11 +17,26 @@ 新增預設案例 + + Add explicit cast + Add explicit cast + + Add file header 新增檔案標頭 + + Alias ambiguous type '{0}' + Alias ambiguous type '{0}' + + + + Convert type to '{0}' + Convert type to '{0}' + + Fix Name Violation: {0} 修正名稱違規: {0} @@ -32,6 +47,16 @@ 修正所有出現之處於 + + Make class 'abstract' + Make class 'abstract' + + + + Make static + Make static + + Remove extra blank lines 移除額外的空白行 diff --git a/src/Features/VisualBasic/Portable/CodeFixes/AddExplicitCast/ArgumentFixer.vb b/src/Analyzers/VisualBasic/CodeFixes/AddExplicitCast/ArgumentFixer.vb similarity index 100% rename from src/Features/VisualBasic/Portable/CodeFixes/AddExplicitCast/ArgumentFixer.vb rename to src/Analyzers/VisualBasic/CodeFixes/AddExplicitCast/ArgumentFixer.vb diff --git a/src/Features/VisualBasic/Portable/CodeFixes/AddExplicitCast/VisualBasicAddExplicitCastCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/AddExplicitCast/VisualBasicAddExplicitCastCodeFixProvider.vb similarity index 100% rename from src/Features/VisualBasic/Portable/CodeFixes/AddExplicitCast/VisualBasicAddExplicitCastCodeFixProvider.vb rename to src/Analyzers/VisualBasic/CodeFixes/AddExplicitCast/VisualBasicAddExplicitCastCodeFixProvider.vb diff --git a/src/Features/VisualBasic/Portable/AddObsoleteAttribute/VisualBasicAddObsoleteAttributeCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/AddObsoleteAttribute/VisualBasicAddObsoleteAttributeCodeFixProvider.vb similarity index 92% rename from src/Features/VisualBasic/Portable/AddObsoleteAttribute/VisualBasicAddObsoleteAttributeCodeFixProvider.vb rename to src/Analyzers/VisualBasic/CodeFixes/AddObsoleteAttribute/VisualBasicAddObsoleteAttributeCodeFixProvider.vb index e82b885f413d5..1495980978a11 100644 --- a/src/Features/VisualBasic/Portable/AddObsoleteAttribute/VisualBasicAddObsoleteAttributeCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/AddObsoleteAttribute/VisualBasicAddObsoleteAttributeCodeFixProvider.vb @@ -23,7 +23,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddObsoleteAttribute Public Sub New() - MyBase.New(VisualBasicSyntaxFacts.Instance, VBFeaturesResources.Add_Obsolete) + MyBase.New(VisualBasicSyntaxFacts.Instance, VisualBasicCodeFixesResources.Add_Obsolete) End Sub End Class End Namespace diff --git a/src/Features/VisualBasic/Portable/AliasAmbiguousType/VisualBasicAliasAmbiguousTypeCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/AliasAmbiguousType/VisualBasicAliasAmbiguousTypeCodeFixProvider.vb similarity index 100% rename from src/Features/VisualBasic/Portable/AliasAmbiguousType/VisualBasicAliasAmbiguousTypeCodeFixProvider.vb rename to src/Analyzers/VisualBasic/CodeFixes/AliasAmbiguousType/VisualBasicAliasAmbiguousTypeCodeFixProvider.vb diff --git a/src/Features/VisualBasic/Portable/CodeFixes/Iterator/VisualBasicChangeToYieldCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/Iterator/VisualBasicChangeToYieldCodeFixProvider.vb similarity index 90% rename from src/Features/VisualBasic/Portable/CodeFixes/Iterator/VisualBasicChangeToYieldCodeFixProvider.vb rename to src/Analyzers/VisualBasic/CodeFixes/Iterator/VisualBasicChangeToYieldCodeFixProvider.vb index 6e6f5bca36e8a..17be22a9ab349 100644 --- a/src/Features/VisualBasic/Portable/CodeFixes/Iterator/VisualBasicChangeToYieldCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/Iterator/VisualBasicChangeToYieldCodeFixProvider.vb @@ -47,10 +47,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator End Function Private Class MyCodeAction - Inherits CodeAction.DocumentChangeAction + Inherits CustomCodeActions.DocumentChangeAction Public Sub New(newDocument As Document) - MyBase.New(VBFeaturesResources.Replace_Return_with_Yield, Function(c) Task.FromResult(newDocument), NameOf(VBFeaturesResources.Replace_Return_with_Yield)) + MyBase.New(VisualBasicCodeFixesResources.Replace_Return_with_Yield, Function(c) Task.FromResult(newDocument), NameOf(VisualBasicCodeFixesResources.Replace_Return_with_Yield)) End Sub End Class End Class diff --git a/src/Features/VisualBasic/Portable/CodeFixes/Iterator/VisualBasicConvertToIteratorCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/Iterator/VisualBasicConvertToIteratorCodeFixProvider.vb similarity index 95% rename from src/Features/VisualBasic/Portable/CodeFixes/Iterator/VisualBasicConvertToIteratorCodeFixProvider.vb rename to src/Analyzers/VisualBasic/CodeFixes/Iterator/VisualBasicConvertToIteratorCodeFixProvider.vb index 38b0605e9848b..25db980a3388e 100644 --- a/src/Features/VisualBasic/Portable/CodeFixes/Iterator/VisualBasicConvertToIteratorCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/Iterator/VisualBasicConvertToIteratorCodeFixProvider.vb @@ -91,7 +91,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator If methodStatementNode IsNot Nothing AndAlso Not methodStatementNode.Modifiers.Any(SyntaxKind.IteratorKeyword) Then root = AddIteratorKeywordToMethod(root, methodStatementNode) Return New MyCodeAction( - String.Format(VBFeaturesResources.Convert_0_to_Iterator, methodStatementNode.Identifier), + String.Format(VisualBasicCodeFixesResources.Convert_0_to_Iterator, methodStatementNode.Identifier), document.WithSyntaxRoot(root)) End If Case SyntaxKind.MultiLineFunctionLambdaExpression @@ -99,7 +99,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator If lambdaNode IsNot Nothing AndAlso Not lambdaNode.SubOrFunctionHeader.Modifiers.Any(SyntaxKind.IteratorKeyword) Then root = AddIteratorKeywordToLambda(root, lambdaNode) Return New MyCodeAction( - String.Format(VBFeaturesResources.Convert_0_to_Iterator, lambdaNode.SubOrFunctionHeader.GetTypeDisplayName()), + String.Format(VisualBasicCodeFixesResources.Convert_0_to_Iterator, lambdaNode.SubOrFunctionHeader.GetTypeDisplayName()), document.WithSyntaxRoot(root)) End If Case Else @@ -137,7 +137,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.CodeFixes.Iterator End Function Private Class MyCodeAction - Inherits CodeAction.DocumentChangeAction + Inherits CustomCodeActions.DocumentChangeAction Public Sub New(title As String, newDocument As Document) MyBase.New(title, Function(c) Task.FromResult(newDocument), title) diff --git a/src/Features/VisualBasic/Portable/MakeTypeAbstract/VisualBasicMakeTypeAbstractCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/MakeTypeAbstract/VisualBasicMakeTypeAbstractCodeFixProvider.vb similarity index 100% rename from src/Features/VisualBasic/Portable/MakeTypeAbstract/VisualBasicMakeTypeAbstractCodeFixProvider.vb rename to src/Analyzers/VisualBasic/CodeFixes/MakeTypeAbstract/VisualBasicMakeTypeAbstractCodeFixProvider.vb diff --git a/src/Features/VisualBasic/Portable/UnsealClass/VisualBasicUnsealClassCodeFixProvider.vb b/src/Analyzers/VisualBasic/CodeFixes/UnsealClass/VisualBasicUnsealClassCodeFixProvider.vb similarity index 96% rename from src/Features/VisualBasic/Portable/UnsealClass/VisualBasicUnsealClassCodeFixProvider.vb rename to src/Analyzers/VisualBasic/CodeFixes/UnsealClass/VisualBasicUnsealClassCodeFixProvider.vb index 3251514ad7e82..f56b78851705c 100644 --- a/src/Features/VisualBasic/Portable/UnsealClass/VisualBasicUnsealClassCodeFixProvider.vb +++ b/src/Analyzers/VisualBasic/CodeFixes/UnsealClass/VisualBasicUnsealClassCodeFixProvider.vb @@ -23,6 +23,6 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.UnsealClass Public Overrides ReadOnly Property FixableDiagnosticIds As ImmutableArray(Of String) = ImmutableArray.Create(BC30299) - Protected Overrides ReadOnly Property TitleFormat As String = VBFeaturesResources.Make_0_inheritable + Protected Overrides ReadOnly Property TitleFormat As String = VisualBasicCodeFixesResources.Make_0_inheritable End Class End Namespace diff --git a/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems index 2882f7ce4c4e4..917b1bda5b7b1 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems +++ b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixes.projitems @@ -15,9 +15,16 @@ + + + + + + + @@ -30,6 +37,7 @@ + diff --git a/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixesResources.resx b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixesResources.resx index 55cf90dc087a5..ce337e1ef8f63 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixesResources.resx +++ b/src/Analyzers/VisualBasic/CodeFixes/VisualBasicCodeFixesResources.resx @@ -129,4 +129,16 @@ Simplify object creation + + Add <Obsolete> + + + Convert {0} to Iterator + + + Make '{0}' inheritable + + + Replace 'Return' with 'Yield + \ No newline at end of file diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.cs.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.cs.xlf index 84601eed62114..7d459d7230421 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.cs.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.cs.xlf @@ -7,16 +7,36 @@ Přidejte položku Me. + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' Převést GetType na NameOf + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Odebrat nepotřebné importy + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Zjednodušit vytváření objektů diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.de.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.de.xlf index faa2d2fbc9306..4dcd262217d23 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.de.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.de.xlf @@ -7,16 +7,36 @@ "Me." hinzufügen + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' "GetType" in "NameOf" konvertieren + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Unnötige Import-Direktiven entfernen + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Objekterstellung vereinfachen diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.es.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.es.xlf index 54c6b14762674..ee3bb962cdaf4 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.es.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.es.xlf @@ -7,16 +7,36 @@ Agregar "Me." + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' Convertir "GetType" en "NameOf" + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Quitar instrucciones Import innecesarias + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Simplificar la creación de objetos diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.fr.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.fr.xlf index 8584f5b3e86dc..c13c35e4233f1 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.fr.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.fr.xlf @@ -7,16 +7,36 @@ Ajouter 'Me.' + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' Convertir 'GetType' en 'NameOf' + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Supprimer les importations superflues + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Simplifier la création d’objets diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.it.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.it.xlf index 67b10955fea03..e2f454f38403a 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.it.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.it.xlf @@ -7,16 +7,36 @@ Aggiungi 'Me.' + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' Convertire 'GetType' in 'NameOf' + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Rimuovi Import non necessari + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Semplificare la creazione di oggetti diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ja.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ja.xlf index 26edc1d2dd6f9..4fedbe676ed57 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ja.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ja.xlf @@ -7,16 +7,36 @@ Me' を追加します。 + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' 'GetType' を 'NameOf' に変換します + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports 不要なインポートの削除 + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation オブジェクトの作成を簡略化 diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ko.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ko.xlf index a201d73df723c..bc96be94a15ab 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ko.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ko.xlf @@ -7,16 +7,36 @@ Me'를 추가하세요. + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' 'GetType'을 'NameOf'로 변환 + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports 불필요한 Imports 제거 + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation 개체 만들기 간소화 diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pl.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pl.xlf index bfdf2192dc0ba..7d42c04f2765a 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pl.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pl.xlf @@ -7,16 +7,36 @@ Dodaj „mnie”. + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' Konwertuj element „GetType” na element „NameOf” + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Usuń niepotrzebne importy + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Upraszczanie tworzenia obiektu diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pt-BR.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pt-BR.xlf index 2120c17d3b82c..c3c71fba1689e 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pt-BR.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.pt-BR.xlf @@ -7,16 +7,36 @@ Adicionar 'Me.' + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' Converter 'GetType' em 'NameOf' + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Remover Importações Desnecessárias + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Simplifique a criação de objetos diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ru.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ru.xlf index 4d8d6ac6363a6..4d21b318e9b85 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ru.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.ru.xlf @@ -7,16 +7,36 @@ Добавьте "Me". + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' Преобразовать "GetType" в "NameOf" + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Удалить ненужные импорты + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Упрощение создания объектов diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.tr.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.tr.xlf index 814c8d6d6b6ef..e16cd9c3d36a2 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.tr.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.tr.xlf @@ -7,16 +7,36 @@ Me' ekleyin. + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' 'GetType' metodunu 'NameOf' metoduna dönüştürün + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports Gereksiz İçeri Aktarmaları Kaldır + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation Nesne oluşturmayı basitleştir diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hans.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hans.xlf index 8e9c0c2dc3775..d1a99eb2ee707 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hans.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hans.xlf @@ -7,16 +7,36 @@ 添加 "Me." + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' 将 "GetType" 转换为 "NameOf" + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports 删除不必要的导入 + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation 简化对象创建 diff --git a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hant.xlf b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hant.xlf index 7f22ec3062619..cb2c1f91f3bce 100644 --- a/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hant.xlf +++ b/src/Analyzers/VisualBasic/CodeFixes/xlf/VisualBasicCodeFixesResources.zh-Hant.xlf @@ -7,16 +7,36 @@ 新增 'Me.' + + Add <Obsolete> + Add <Obsolete> + + + + Convert {0} to Iterator + Convert {0} to Iterator + + Convert 'GetType' to 'NameOf' 將 'GetType' 轉換為 'NameOf' + + Make '{0}' inheritable + Make '{0}' inheritable + + Remove Unnecessary Imports 移除不必要的匯入 + + Replace 'Return' with 'Yield + Replace 'Return' with 'Yield + + Simplify object creation 簡化物件建立 diff --git a/src/EditorFeatures/VisualBasicTest/Diagnostics/AddExplicitCast/AddExplicitCastTests.vb b/src/Analyzers/VisualBasic/Tests/AddExplicitCast/AddExplicitCastTests.vb similarity index 99% rename from src/EditorFeatures/VisualBasicTest/Diagnostics/AddExplicitCast/AddExplicitCastTests.vb rename to src/Analyzers/VisualBasic/Tests/AddExplicitCast/AddExplicitCastTests.vb index 0a7006780d35f..daaf165d1f54b 100644 --- a/src/EditorFeatures/VisualBasicTest/Diagnostics/AddExplicitCast/AddExplicitCastTests.vb +++ b/src/Analyzers/VisualBasic/Tests/AddExplicitCast/AddExplicitCastTests.vb @@ -2959,10 +2959,10 @@ Class Program End Class End Class" Await TestInRegularAndScriptAsync(initialMarkup, String.Format(expect_format, "Derived"), index:=0, - title:=String.Format(FeaturesResources.Convert_type_to_0, "Derived")) + title:=String.Format(CodeFixesResources.Convert_type_to_0, "Derived")) Await TestInRegularAndScriptAsync(initialMarkup, String.Format(expect_format, "Derived2"), index:=1, - title:=String.Format(FeaturesResources.Convert_type_to_0, "Derived2")) + title:=String.Format(CodeFixesResources.Convert_type_to_0, "Derived2")) End Function @@ -3025,10 +3025,10 @@ Class Program End Class End Class" Await TestInRegularAndScriptAsync(initialMarkup, String.Format(expect_format, "Derived"), index:=0, - title:=String.Format(FeaturesResources.Convert_type_to_0, "Derived")) + title:=String.Format(CodeFixesResources.Convert_type_to_0, "Derived")) Await TestInRegularAndScriptAsync(initialMarkup, String.Format(expect_format, "Derived2"), index:=1, - title:=String.Format(FeaturesResources.Convert_type_to_0, "Derived2")) + title:=String.Format(CodeFixesResources.Convert_type_to_0, "Derived2")) End Function @@ -3220,13 +3220,13 @@ Class Program End Class" Await TestInRegularAndScriptAsync(initialMarkup, String.Format(expect_format, "CStr(b)"), index:=0, - title:=String.Format(FeaturesResources.Convert_type_to_0, "String")) + title:=String.Format(CodeFixesResources.Convert_type_to_0, "String")) Await TestInRegularAndScriptAsync(initialMarkup, String.Format(expect_format, "CType(b, Derived)"), index:=1, - title:=String.Format(FeaturesResources.Convert_type_to_0, "Derived")) + title:=String.Format(CodeFixesResources.Convert_type_to_0, "Derived")) Await TestInRegularAndScriptAsync(initialMarkup, String.Format(expect_format, "CType(b, Derived2)"), index:=2, - title:=String.Format(FeaturesResources.Convert_type_to_0, "Derived2")) + title:=String.Format(CodeFixesResources.Convert_type_to_0, "Derived2")) End Function diff --git a/src/EditorFeatures/VisualBasicTest/Diagnostics/AddExplicitCast/AddExplicitCastTests_FixAllTests.vb b/src/Analyzers/VisualBasic/Tests/AddExplicitCast/AddExplicitCastTests_FixAllTests.vb similarity index 100% rename from src/EditorFeatures/VisualBasicTest/Diagnostics/AddExplicitCast/AddExplicitCastTests_FixAllTests.vb rename to src/Analyzers/VisualBasic/Tests/AddExplicitCast/AddExplicitCastTests_FixAllTests.vb diff --git a/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems b/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems index 74d64f96eef64..9d44e1576f130 100644 --- a/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems +++ b/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems @@ -10,6 +10,8 @@ + + diff --git a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx index f044789c39656..99f8a8bc3e28a 100644 --- a/src/Features/CSharp/Portable/CSharpFeaturesResources.resx +++ b/src/Features/CSharp/Portable/CSharpFeaturesResources.resx @@ -126,10 +126,6 @@ Invert if - - Add 'await' - {Locked="await"} "await" is a C# keyword and should not be localized. - Add 'await' and 'ConfigureAwait(false)' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -170,12 +166,6 @@ Autoselect disabled due to potential range variable declaration. - - Declare as nullable - - - Fix return type - Simplify name '{0}' @@ -248,12 +238,6 @@ Make {0} return Task instead of void. - - Change return type from {0} to {1} - - - Replace return with yield return - Generate explicit conversion operator in '{0}' @@ -435,9 +419,6 @@ The name '{0}' does not exist in the current context. - - Hide base member - Remove 'new' modifier @@ -513,9 +494,6 @@ Allow unsafe code in this project - - Add [Obsolete] - Convert to method @@ -545,9 +523,6 @@ Introduce 'using' statement {Locked="using"} "using" is a C# keyword and should not be localized. - - Unseal class '{0}' - Make 'ref struct' {Locked="ref"}{Locked="struct"} "ref" and "struct" are C# keywords and should not be localized. @@ -586,12 +561,6 @@ Convert to verbatim string - - Assign to '{0}' - - - Compare to '{0}' - Apply preferred 'using' placement preferences 'using' is a C# keyword and should not be localized @@ -681,4 +650,8 @@ Apply 'var' preferences + + Add 'await' + {Locked="await"} "await" is a C# keyword and should not be localized. + \ No newline at end of file diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf index 85c8bbbd044d4..a2a63388c075c 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.cs.xlf @@ -4,7 +4,7 @@ Add 'await' - Přidat await + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ Přiřadit parametry out (při spuštění) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - Přiřadit k {0} - - Autoselect disabled due to potential pattern variable declaration. Automatický výběr je zakázaný kvůli možné deklaraci proměnné vzoru. @@ -167,11 +162,6 @@ Změnit na přetypování - - Compare to '{0}' - Porovnat s {0} - - Convert to method Převést na metodu @@ -207,21 +197,11 @@ Převést na doslovný řetězec - - Declare as nullable - Deklarovat jako s možnou hodnotou null - - Enable nullable reference types in project Povolit v projektu typy odkazů s možnou hodnotou null - - Fix return type - Opravit návratový typ - - Inline temporary variable Dočasná vložená proměnná @@ -277,11 +257,6 @@ Zjednodušit všechny výskyty - - Unseal class '{0}' - Rozpečetit třídu {0} - - Use recursive patterns Použít rekurzivní vzory @@ -487,16 +462,6 @@ Nastavit, že {0} má místo hodnoty typu Void vracet hodnotu Task - - Change return type from {0} to {1} - Změnit typ návratové hodnoty z: {0} na: {1} - - - - Replace return with yield return - Nahradit příkaz return příkazem yield return - - Generate explicit conversion operator in '{0}' Generovat explicitní operátor převodu v {0} @@ -737,11 +702,6 @@ Název {0} v aktuálním kontextu neexistuje. - - Hide base member - Skrýt základního člena - - Properties Vlastnosti @@ -847,11 +807,6 @@ Invertovat if - - Add [Obsolete] - Přidat [Obsolete] - - Use '{0}' Použít {0} diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf index c12082919f2b8..931af921e0572 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.de.xlf @@ -4,7 +4,7 @@ Add 'await' - "await" hinzufügen + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ out-Parameter zuweisen (beim Start) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - "{0}" zuweisen - - Autoselect disabled due to potential pattern variable declaration. Automatische Auswahl aufgrund einer potenziellen Mustervariablendeklaration deaktiviert. @@ -167,11 +162,6 @@ In "cast" ändern - - Compare to '{0}' - Mit "{0}" vergleichen - - Convert to method In Methode konvertieren @@ -207,21 +197,11 @@ In ausführliche Zeichenfolge konvertieren - - Declare as nullable - Als für NULL-Werte zulässig deklarieren - - Enable nullable reference types in project Nullwerte zulassende Verweistypen im Projekt aktivieren - - Fix return type - Rückgabetyp korrigieren - - Inline temporary variable Inline temporär variabel @@ -277,11 +257,6 @@ Alle Vorkommen vereinfachen - - Unseal class '{0}' - Versiegelung der Klasse "{0}" aufheben - - Use recursive patterns Verwenden rekursiver Muster @@ -487,16 +462,6 @@ "{0}" in Rückgabeaufgabe umwandeln, statt leer zu lassen. - - Change return type from {0} to {1} - Rückgabetyp von "{0}" in "{1}" ändern - - - - Replace return with yield return - "return" durch "yield return" ersetzen - - Generate explicit conversion operator in '{0}' Expliziten Konversionsoperator in '{0}' generieren @@ -737,11 +702,6 @@ Der Name "{0}" ist im aktuellen Kontext nicht vorhanden. - - Hide base member - Basismember ausblenden - - Properties Eigenschaften @@ -847,11 +807,6 @@ "If" umkehren - - Add [Obsolete] - Hinzufügen [veraltet] - - Use '{0}' "{0}" verwenden diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf index 80ab9c22659f4..22afeae81b95b 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.es.xlf @@ -4,7 +4,7 @@ Add 'await' - Agregar "await" + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ Asignar parámetros "out" (al inicio) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - Asignar a "{0}" - - Autoselect disabled due to potential pattern variable declaration. La selección automática se ha deshabilitado debido a una posible declaración de variable de patrón. @@ -167,11 +162,6 @@ Cambiar a cast - - Compare to '{0}' - Comparar con "{0}" - - Convert to method Convertir al método @@ -207,21 +197,11 @@ Convertir en cadena textual - - Declare as nullable - Declara como que acepta valores NULL - - Enable nullable reference types in project Habilitar tipos de referencia que aceptan valores NULL en el proyecto - - Fix return type - Corregir tipo de valor devuelto - - Inline temporary variable Variable temporal en línea @@ -277,11 +257,6 @@ Simplificar todas las repeticiones - - Unseal class '{0}' - Quitar el sello de la clase "{0}" - - Use recursive patterns Usar patrones recursivos @@ -487,16 +462,6 @@ Hacer que {0} devuelva Tarea en lugar de void. - - Change return type from {0} to {1} - Cambiar el tipo de valor devuelto de {0} a {1} - - - - Replace return with yield return - Reemplazar return por yield return - - Generate explicit conversion operator in '{0}' Generar operador de conversión explícito en '{0}' @@ -737,11 +702,6 @@ El nombre '{0}' no existe en el contexto actual. - - Hide base member - Ocultar miembro base - - Properties Propiedades @@ -847,11 +807,6 @@ Invertir If - - Add [Obsolete] - Agregar [obsoleto] - - Use '{0}' Usar "{0}" diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf index 01e211a5331a2..43e9f8d7566b7 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.fr.xlf @@ -4,7 +4,7 @@ Add 'await' - Ajouter 'await' + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ Assigner des paramètres 'out' (au début) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - Affecter à '{0}' - - Autoselect disabled due to potential pattern variable declaration. Sélection automatique désactivée en raison d'une déclaration de variable de modèle éventuelle. @@ -167,11 +162,6 @@ Changer en cast - - Compare to '{0}' - Comparer à '{0}' - - Convert to method Convertir en méthode @@ -207,21 +197,11 @@ Convertir en chaîne verbatim - - Declare as nullable - Déclarer comme nullable - - Enable nullable reference types in project Activer les types de référence nullables dans le projet - - Fix return type - Corriger le type de retour - - Inline temporary variable Variable temporaire inline @@ -277,11 +257,6 @@ Simplifier toutes les occurrences - - Unseal class '{0}' - Classe unsealed '{0}' - - Use recursive patterns Utiliser des modèles récursifs @@ -487,16 +462,6 @@ {0} doit retourner Task au lieu de void. - - Change return type from {0} to {1} - Changer le type de retour de {0} en {1} - - - - Replace return with yield return - Remplacer return par yield return - - Generate explicit conversion operator in '{0}' Générer l’opérateur de conversion explicite dans « {0} » @@ -737,11 +702,6 @@ Le nom '{0}' n'existe pas dans le contexte actuel. - - Hide base member - Masquer le membre de base - - Properties Propriétés @@ -847,11 +807,6 @@ Inverser si - - Add [Obsolete] - Ajouter [obsolète] - - Use '{0}' Utiliser '{0}' diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf index b9c2e6a6c5a2b..af173240fc50a 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.it.xlf @@ -4,7 +4,7 @@ Add 'await' - Aggiungi 'await' + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ Assegnare parametri 'out' (all'inizio) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - Assegna a '{0}' - - Autoselect disabled due to potential pattern variable declaration. La selezione automatica è disabilitata a causa di una potenziale dichiarazione della variabile di criterio. @@ -167,11 +162,6 @@ Cambia in cast - - Compare to '{0}' - Confronta con '{0}' - - Convert to method Converti in metodo @@ -207,21 +197,11 @@ Converti in stringa verbatim - - Declare as nullable - Dichiara come nullable - - Enable nullable reference types in project Abilita tipi riferimento nullable nel progetto - - Fix return type - Correggi il tipo restituito - - Inline temporary variable Variabile temporanea inline @@ -277,11 +257,6 @@ Semplifica tutte le occorrenze - - Unseal class '{0}' - Rimuovi seal dalla classe '{0}' - - Use recursive patterns Usa criteri ricorsivi @@ -487,16 +462,6 @@ Fa in modo che {0} restituisca Task invece di void. - - Change return type from {0} to {1} - Modifica il tipo restituito da {0} in {1} - - - - Replace return with yield return - Sostituisce return con yield return - - Generate explicit conversion operator in '{0}' Genera l'operatore di conversione esplicito in '{0}' @@ -737,11 +702,6 @@ Il nome '{0}' non esiste nel contesto corrente. - - Hide base member - Nascondi il membro di base - - Properties Proprietà @@ -847,11 +807,6 @@ Inverti if - - Add [Obsolete] - Aggiungi [obsoleto] - - Use '{0}' Usa '{0}' diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf index 1f9b8b637eaff..63e42fbdfe60e 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ja.xlf @@ -4,7 +4,7 @@ Add 'await' - 'await' の追加 + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ 'out' パラメーターの割り当て (開始時) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - "{0}" に割り当て - - Autoselect disabled due to potential pattern variable declaration. パターン変数宣言の可能性があるため、自動選択は無効になっています。 @@ -167,11 +162,6 @@ キャストに変更 - - Compare to '{0}' - "{0}" と比較 - - Convert to method メソッドに変換 @@ -207,21 +197,11 @@ 逐語的文字列に変換する - - Declare as nullable - Null 許容型として宣言する - - Enable nullable reference types in project プロジェクトで null 許容参照型を有効にする - - Fix return type - 戻り値の型の修正 - - Inline temporary variable インラインの一時変数 @@ -277,11 +257,6 @@ すべての出現箇所を簡素化します - - Unseal class '{0}' - クラス '{0}' のシールを解除 - - Use recursive patterns 再帰パターンを使用する @@ -487,16 +462,6 @@ {0} が void ではなくタスクを返すようにします。 - - Change return type from {0} to {1} - 戻り値の型を {0} から {1} に変更する - - - - Replace return with yield return - 戻り値を 'yield' の戻り値に置き換える - - Generate explicit conversion operator in '{0}' 明示的な変換演算子を '{0}' に生成します @@ -737,11 +702,6 @@ 名前 '{0}' は、現在のコンテキストに存在しません。 - - Hide base member - 基本メンバーを非表示にします - - Properties プロパティ @@ -847,11 +807,6 @@ if を反転する - - Add [Obsolete] - 追加 [廃止] - - Use '{0}' '{0}' を使用します diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf index 1de66d4ea5304..f98b61f0d4b8e 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ko.xlf @@ -4,7 +4,7 @@ Add 'await' - 'await' 추가 + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ 'out' 매개 변수 할당(시작 시) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - '{0}'에 할당 - - Autoselect disabled due to potential pattern variable declaration. 잠재적인 패턴 변수 선언으로 인해 자동 선택을 사용하지 않도록 설정했습니다. @@ -167,11 +162,6 @@ 캐스트로 변경 - - Compare to '{0}' - '{0}'과(와) 비교 - - Convert to method 메서드로 변환 @@ -207,21 +197,11 @@ 축자 문자열로 변환 - - Declare as nullable - Nullable로 선언 - - Enable nullable reference types in project 프로젝트에서 null 허용 참조 형식 사용 - - Fix return type - 반환 형식 수정 - - Inline temporary variable 인라인 임시 변수 @@ -277,11 +257,6 @@ 모든 항목 단순화 - - Unseal class '{0}' - '{0}' 클래스 봉인 해제 - - Use recursive patterns 재귀 패턴 사용 @@ -487,16 +462,6 @@ {0}에서 void 대신 Task를 반환하도록 설정합니다. - - Change return type from {0} to {1} - 반환 형식을 {0}에서 {1}(으)로 변경 - - - - Replace return with yield return - return을 yield return으로 바꾸기 - - Generate explicit conversion operator in '{0}' '{0}'에서 명시적 변환 연산자 생성 @@ -737,11 +702,6 @@ 이름 '{0}'이(가) 현재 컨텍스트에 없습니다. - - Hide base member - 기본 멤버 숨기기 - - Properties 속성 @@ -847,11 +807,6 @@ if 반전 - - Add [Obsolete] - [Obsolete] 추가 - - Use '{0}' '{0}' 사용 diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf index fa44f615f1c3b..19ac497d5fe4f 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pl.xlf @@ -4,7 +4,7 @@ Add 'await' - Dodaj operator „await” + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ Przypisz parametry „out” (na początku) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - Przypisz do „{0}” - - Autoselect disabled due to potential pattern variable declaration. Automatyczne wybieranie zostało wyłączone z powodu możliwej deklaracji zmiennej wzorca. @@ -167,11 +162,6 @@ Zmień na rzutowanie - - Compare to '{0}' - Porównaj z „{0}” - - Convert to method Konwertuj na metodę @@ -207,21 +197,11 @@ Konwertuj na ciąg dosłowny - - Declare as nullable - Zadeklaruj jako dopuszczający wartość null - - Enable nullable reference types in project Włącz typy referencyjne dopuszczające wartości null w projekcie - - Fix return type - Napraw zwracany typ - - Inline temporary variable Wstawiona zmienna tymczasowa @@ -277,11 +257,6 @@ Uprość wszystkie wystąpienia - - Unseal class '{0}' - Odpieczętuj klasę „{0}” - - Use recursive patterns Używanie wzorców rekursywnych @@ -487,16 +462,6 @@ Ustaw element {0}, aby zwracał zadanie zamiast elementu void. - - Change return type from {0} to {1} - Zmień zwracany typ z {0} na {1} - - - - Replace return with yield return - Zamień instrukcję return na instrukcję yield return - - Generate explicit conversion operator in '{0}' Generuj operator jawnej konwersji w elemencie „{0}” @@ -737,11 +702,6 @@ Nazwa „{0}” nie istnieje w bieżącym kontekście. - - Hide base member - Ukryj składową bazową - - Properties Właściwości @@ -847,11 +807,6 @@ Odwróć instrukcję if - - Add [Obsolete] - Dodaj [przestarzałe] - - Use '{0}' Użyj elementu „{0}” diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf index 7007a8aa54150..17e96e2ef6d9a 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.pt-BR.xlf @@ -4,7 +4,7 @@ Add 'await' - Adicionar 'await' + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ Atribuir parâmetros 'out' (no início) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - Atribuir a '{0}' - - Autoselect disabled due to potential pattern variable declaration. Seleção automática desabilitada devido a uma possível declaração de variável de padrão. @@ -167,11 +162,6 @@ Alterar para conversão - - Compare to '{0}' - Comparar a '{0}' - - Convert to method Converter em método @@ -207,21 +197,11 @@ Converter para cadeia de caracteres verbatim - - Declare as nullable - Declarar como anulável - - Enable nullable reference types in project Habilitar os tipos de referência anuláveis no projeto - - Fix return type - Corrigir o tipo de retorno - - Inline temporary variable Variável temporária embutida @@ -277,11 +257,6 @@ Simplificar todas as ocorrências - - Unseal class '{0}' - Desselar a classe '{0}' - - Use recursive patterns Usar padrões recursivos @@ -487,16 +462,6 @@ Fazer com que {0} retorne Tarefa em vez de nulo. - - Change return type from {0} to {1} - Alterar tipo de retorno de {0} para {1} - - - - Replace return with yield return - Substituir return por yield return - - Generate explicit conversion operator in '{0}' Gerar um operador de conversão explícita em '{0}' @@ -737,11 +702,6 @@ O nome '{0}' não existe no contexto atual. - - Hide base member - Ocultar o membro base - - Properties Propriedades @@ -847,11 +807,6 @@ Inverter If - - Add [Obsolete] - Adicionar [Obsolete] - - Use '{0}' Usar '{0}' diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf index b2a6c537e66e3..f896a2388e2dd 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.ru.xlf @@ -4,7 +4,7 @@ Add 'await' - Добавить "await" + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ Присвоение значений параметров "out" (при запуске) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - Назначить "{0}" - - Autoselect disabled due to potential pattern variable declaration. Автовыбор отключен из-за возможного объявления переменной шаблона. @@ -167,11 +162,6 @@ Изменить на приведение - - Compare to '{0}' - Сравнить с "{0}" - - Convert to method Преобразовать в метод @@ -207,21 +197,11 @@ Преобразовать в строку verbatim - - Declare as nullable - Объявить как тип, допускающий значения null - - Enable nullable reference types in project Включить типы ссылок, допускающие значение NULL, в проекте - - Fix return type - Исправить тип возвращаемых значений - - Inline temporary variable Встроенная временная переменная @@ -277,11 +257,6 @@ Упростить все вхождения - - Unseal class '{0}' - Распечатать класс "{0}" - - Use recursive patterns Использовать рекурсивные шаблоны @@ -487,16 +462,6 @@ Сделать {0} задачей возврата вместо void. - - Change return type from {0} to {1} - Изменить тип возврата с {0} на {1} - - - - Replace return with yield return - Заменить тип возврата на yield - - Generate explicit conversion operator in '{0}' Создать явный оператор преобразования в "{0}" @@ -737,11 +702,6 @@ Имя "{0}" не существует в текущем контексте. - - Hide base member - Скрыть базовый член - - Properties Свойства @@ -847,11 +807,6 @@ Инвертировать оператор if - - Add [Obsolete] - Добавить [устарело] - - Use '{0}' Использовать "{0}" diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf index 0c473c063dddf..50888aa59f794 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.tr.xlf @@ -4,7 +4,7 @@ Add 'await' - 'await' ekleyin + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ 'out' parametreleri ata (başlangıçta) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - '{0}' öğesine ata - - Autoselect disabled due to potential pattern variable declaration. Otomatik seçim, olası desen değişkeni bildirimi nedeniyle devre dışı bırakıldı. @@ -167,11 +162,6 @@ Tür dönüştürme olarak değiştir - - Compare to '{0}' - '{0}' ile karşılaştır - - Convert to method Yönteme dönüştür @@ -207,21 +197,11 @@ Düz metin dizesine dönüştür - - Declare as nullable - Olarak null olabilecek ilan - - Enable nullable reference types in project Projedeki null atanabilir başvuru türlerini etkinleştir - - Fix return type - Dönüş türünü düzelt - - Inline temporary variable Satır içi geçici değişken @@ -277,11 +257,6 @@ Tüm yinelemeleri basitleştir - - Unseal class '{0}' - '{0}' sınıfının mührünü aç - - Use recursive patterns Özyinelemeli desenler kullan @@ -487,16 +462,6 @@ {0} öğesi boşluk yerine Görev döndürsün. - - Change return type from {0} to {1} - Dönüş türünü {0} değerinden {1} olarak değiştir - - - - Replace return with yield return - Dönüşü, bırakma dönüşüyle değiştir - - Generate explicit conversion operator in '{0}' '{0}' içinde açık dönüşüm işleci oluştur @@ -737,11 +702,6 @@ '{0}' adı geçerli bağlamda yok. - - Hide base member - Temel üyeyi gizle - - Properties Özellikler @@ -847,11 +807,6 @@ if ifadesini tersine çevir - - Add [Obsolete] - Ekle [Eski] - - Use '{0}' '{0}' kullan diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf index 6c100501b63c1..b233668990881 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hans.xlf @@ -4,7 +4,7 @@ Add 'await' - 添加 "await" + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ 为 "out" 赋值 (在开始处) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - 赋值给 "{0}" - - Autoselect disabled due to potential pattern variable declaration. 由于可能出现模式变量声明,已禁用自动选择。 @@ -167,11 +162,6 @@ 更改为强制转换 - - Compare to '{0}' - 与 "{0}" 比较 - - Convert to method 转换为方法 @@ -207,21 +197,11 @@ 转换为逐字字符串 - - Declare as nullable - 声明成可为 null - - Enable nullable reference types in project 在项目中启用可为 null 的引用类型 - - Fix return type - 修复返回类型 - - Inline temporary variable 内联临时变量 @@ -277,11 +257,6 @@ 简化所有事件 - - Unseal class '{0}' - Unseal 类 "{0}" - - Use recursive patterns 使用递归模式 @@ -487,16 +462,6 @@ 使 {0} 返回 Task,而不是 void。 - - Change return type from {0} to {1} - 将返回类型由 {0} 改为 {1} - - - - Replace return with yield return - 用 yield return 替代 return - - Generate explicit conversion operator in '{0}' 在“{0}”中生成显示转换运算符 @@ -737,11 +702,6 @@ 当前上下文中不存在名称“{0}”。 - - Hide base member - 隐藏基成员 - - Properties 属性 @@ -847,11 +807,6 @@ 反转 if - - Add [Obsolete] - 添加 [Obsolete] - - Use '{0}' 使用 "{0}" diff --git a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf index f496739b07296..e7502d139273d 100644 --- a/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf +++ b/src/Features/CSharp/Portable/xlf/CSharpFeaturesResources.zh-Hant.xlf @@ -4,7 +4,7 @@ Add 'await' - 新增 'await' + Add 'await' {Locked="await"} "await" is a C# keyword and should not be localized. @@ -147,11 +147,6 @@ 指派 'out' 參數 (開始時) {Locked="out"} "out" is a C# keyword and should not be localized. - - Assign to '{0}' - 指派給 '{0}' - - Autoselect disabled due to potential pattern variable declaration. 因為潛在的範圍變數宣告,所以停用了自動選取。 @@ -167,11 +162,6 @@ 變更為 'cast' - - Compare to '{0}' - 與 '{0}' 比較 - - Convert to method 轉換為方法 @@ -207,21 +197,11 @@ 轉換為逐字字串 - - Declare as nullable - 宣告為可為 Null - - Enable nullable reference types in project 在專案中啟用可為 Null 的參考類型 - - Fix return type - 修正傳回型別 - - Inline temporary variable 內嵌暫存變數 @@ -277,11 +257,6 @@ 簡化所有項目 - - Unseal class '{0}' - 為類別 '{0}' 解密 - - Use recursive patterns 使用遞迴模式 @@ -487,16 +462,6 @@ 使 {0} 傳回 Task 而不是 void。 - - Change return type from {0} to {1} - 將傳回類型從 {0} 變更為 {1} - - - - Replace return with yield return - 使用 yield return 取代 return - - Generate explicit conversion operator in '{0}' 在 '{0}' 中產生明確轉換運算子 @@ -737,11 +702,6 @@ 目前內容中沒有名稱 '{0}'。 - - Hide base member - 隱藏基底成員 - - Properties 屬性 @@ -847,11 +807,6 @@ 反轉 if - - Add [Obsolete] - 新增 [Obsolete] - - Use '{0}' 使用 '{0}' diff --git a/src/Features/Core/Portable/FeaturesResources.resx b/src/Features/Core/Portable/FeaturesResources.resx index 41b1e6733cf0b..3c65b32517715 100644 --- a/src/Features/Core/Portable/FeaturesResources.resx +++ b/src/Features/Core/Portable/FeaturesResources.resx @@ -987,9 +987,6 @@ This version used in: {2} project {0} - - Use interpolated verbatim string - Fix typo '{0}' @@ -1158,9 +1155,6 @@ This version used in: {2} indexer - - Alias ambiguous type '{0}' - Warning: Collection was modified during iteration. @@ -1439,9 +1433,6 @@ This version used in: {2} Implement '{0}' explicitly - - Make static - TODO "TODO" is an indication that there is work still to be done. @@ -1952,9 +1943,6 @@ If the "H" format specifier is used without other custom format specifiers, it's Create and assign remaining as properties - - Add explicit cast - Example: Singular form when we want to show an example, but only have one to show. @@ -2757,9 +2745,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of <infer> - - Convert type to '{0}' - from metadata @@ -2778,9 +2763,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Property reference cannot be updated - - Make class 'abstract' - Inline '{0}' @@ -2942,9 +2924,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Miscellaneous Files - - Explicitly inherit documentation - Silent @@ -3211,4 +3190,4 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Sort Imports or usings - + \ No newline at end of file diff --git a/src/Features/Core/Portable/ImplementAbstractClass/AbstractImplementAbstractClassCodeFixProvider.cs b/src/Features/Core/Portable/ImplementAbstractClass/AbstractImplementAbstractClassCodeFixProvider.cs index 7ced21bcb6e74..6c475f8fd7d8d 100644 --- a/src/Features/Core/Portable/ImplementAbstractClass/AbstractImplementAbstractClassCodeFixProvider.cs +++ b/src/Features/Core/Portable/ImplementAbstractClass/AbstractImplementAbstractClassCodeFixProvider.cs @@ -71,7 +71,7 @@ public sealed override async Task RegisterCodeFixesAsync(CodeFixContext context) private static string GetCodeActionId(string assemblyName, string abstractTypeFullyQualifiedName, string through = "") => FeaturesResources.Implement_abstract_class + ";" + assemblyName + ";" + abstractTypeFullyQualifiedName + ";" + through; - private class MyCodeAction : CodeAction.DocumentChangeAction + private class MyCodeAction : CustomCodeActions.DocumentChangeAction { public MyCodeAction(string title, Func> createChangedDocument, string id) : base(title, createChangedDocument, id) diff --git a/src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs b/src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs index f0fff28719459..448d83a0fd3b0 100644 --- a/src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs +++ b/src/Features/Core/Portable/UseAutoProperty/AbstractUseAutoPropertyCodeFixProvider.cs @@ -342,13 +342,21 @@ private static bool IsWrittenToOutsideOfConstructorOrProperty( private class UseAutoPropertyCodeAction : CustomCodeActions.SolutionChangeAction { - public UseAutoPropertyCodeAction(string title, Func> createChangedSolution, CodeActionPriority priority) + public UseAutoPropertyCodeAction(string title, Func> createChangedSolution +#if !CODE_STYLE // 'CodeActionPriority' is not a public API, hence not supported in CodeStyle layer. + , CodeActionPriority priority +#endif + ) : base(title, createChangedSolution, title) { +#if !CODE_STYLE // 'CodeActionPriority' is not a public API, hence not supported in CodeStyle layer. Priority = priority; +#endif } +#if !CODE_STYLE // 'CodeActionPriority' is not a public API, hence not supported in CodeStyle layer. internal override CodeActionPriority Priority { get; } +#endif } } } diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf index 5fd5033967618..ab80d944a718e 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.cs.xlf @@ -50,11 +50,6 @@ Ujistěte se, že specifikátor tt použijete pro jazyky, pro které je nezbytn Přidat atribut DebuggerDisplay {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Přidat explicitní přetypování - - Add member name Přidat název členu @@ -570,11 +565,6 @@ Ujistěte se, že specifikátor tt použijete pro jazyky, pro které je nezbytn Převést na řazenou kolekci členů - - Convert type to '{0}' - Převést typ na {0} - - Could not find portable PDB on disk or embedded. Na disku nebo vloženém disku se nepovedlo najít přenosný soubor PDB. @@ -695,11 +685,6 @@ Ujistěte se, že specifikátor tt použijete pro jazyky, pro které je nezbytn Explicitně implementované metody záznamů musí mít názvy parametrů, které odpovídají kompilátorem vygenerovanému ekvivalentu {0}. - - Explicitly inherit documentation - Explicitně dědit dokumentaci - - Extract base class... Extrahovat základní třídu... @@ -1045,16 +1030,6 @@ Ujistěte se, že specifikátor tt použijete pro jazyky, pro které je nezbytn JSON issue: {0} - - Make class 'abstract' - Nastavit třídu jako abstract - - - - Make static - Nastavit jako statickou - - Invert conditional Převrátit podmínku @@ -2910,11 +2885,6 @@ Pozitivní kontrolní výrazy zpětného vyhledávání s nulovou délkou se obv Používat text výrazu pro lambda výrazy - - Use interpolated verbatim string - Použít interpolovaný doslovný řetězec - - Value: Hodnota: @@ -4890,11 +4860,6 @@ Tato verze se používá zde: {2}. indexer - - Alias ambiguous type '{0}' - Alias nejednoznačného typu {0} - - Warning: Collection was modified during iteration. Upozornění: Během iterace se kolekce změnila. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf index 226519d25c171..a37e19fd09152 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.de.xlf @@ -50,11 +50,6 @@ Stellen Sie sicher, dass Sie den Bezeichner "tt" für Sprachen verwenden, für d DebuggerDisplay-Attribut hinzufügen {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Explizite Umwandlung hinzufügen - - Add member name Membername hinzufügen @@ -570,11 +565,6 @@ Stellen Sie sicher, dass Sie den Bezeichner "tt" für Sprachen verwenden, für d In Tupel konvertieren - - Convert type to '{0}' - Typ in "{0}" konvertieren - - Could not find portable PDB on disk or embedded. Die portierbare PDB-Datei wurde nicht auf dem Datenträger oder eingebettet gefunden. @@ -695,11 +685,6 @@ Stellen Sie sicher, dass Sie den Bezeichner "tt" für Sprachen verwenden, für d Explizit implementierte Methoden von Datensätzen müssen Parameternamen aufweisen, die mit dem vom Compiler generierten Äquivalent "{0}" übereinstimmen. - - Explicitly inherit documentation - Dokumentation explizit erben - - Extract base class... Basisklasse extrahieren... @@ -1045,16 +1030,6 @@ Stellen Sie sicher, dass Sie den Bezeichner "tt" für Sprachen verwenden, für d JSON issue: {0} - - Make class 'abstract' - Klasse als "abstract" festlegen - - - - Make static - Als statisch festlegen - - Invert conditional Bedingten Operator umkehren @@ -2910,11 +2885,6 @@ Positive Lookbehindassertionen mit Nullbreite werden normalerweise am Anfang reg Ausdruckskörper für Lambdaausdrücke verwenden - - Use interpolated verbatim string - Interpolierte ausführliche Zeichenfolge verwenden - - Value: Wert: @@ -4890,11 +4860,6 @@ Diese Version wird verwendet in: {2} Indexer - - Alias ambiguous type '{0}' - Nicht eindeutiger Aliastyp "{0}" - - Warning: Collection was modified during iteration. Warnung: Die Sammlung wurde bei der Iteration geändert. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf index 3a948000364b2..9b42edfc6db9c 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.es.xlf @@ -50,11 +50,6 @@ Asegúrese de usar el especificador "tt" para los idiomas para los que es necesa Agregar atributo de "DebuggerDisplay" {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Agregar conversión explícita - - Add member name Agregar nombre de miembro @@ -570,11 +565,6 @@ Asegúrese de usar el especificador "tt" para los idiomas para los que es necesa Convertir a tupla - - Convert type to '{0}' - Convertir tipo en "{0}" - - Could not find portable PDB on disk or embedded. No se pudo encontrar el archivo PDB portátil en el disco o incrustado. @@ -695,11 +685,6 @@ Asegúrese de usar el especificador "tt" para los idiomas para los que es necesa Los métodos de registros implementados explícitamente deben tener nombres de parámetro que coincidan con el equivalente generado por el programa "{0}" - - Explicitly inherit documentation - Heredar explícitamente la documentación - - Extract base class... Extraer clase base... @@ -1045,16 +1030,6 @@ Asegúrese de usar el especificador "tt" para los idiomas para los que es necesa JSON issue: {0} - - Make class 'abstract' - Convertir la clase en "abstract" - - - - Make static - Hacer estático - - Invert conditional Invertir condicional @@ -2910,11 +2885,6 @@ Las aserciones de búsqueda retrasada (lookbehind) positivas de ancho cero se us Usar órgano de expresión para expresiones lambda - - Use interpolated verbatim string - Utilizar cadenas verbatim interpoladas - - Value: Valor: @@ -4890,11 +4860,6 @@ Esta versión se utiliza en: {2} indizador - - Alias ambiguous type '{0}' - Tipo de alias ambiguo "{0}" - - Warning: Collection was modified during iteration. Advertencia: la colección se modificó durante la iteración. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf index d2ee7c45cf50b..9b7317fcb1dd1 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.fr.xlf @@ -50,11 +50,6 @@ Veillez à utiliser le spécificateur "tt" pour les langues où il est nécessai Ajouter l'attribut 'DebuggerDisplay' {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Ajouter un cast explicite - - Add member name Ajouter le nom du membre @@ -570,11 +565,6 @@ Veillez à utiliser le spécificateur "tt" pour les langues où il est nécessai Convertir en tuple - - Convert type to '{0}' - Convertir le type en '{0}' - - Could not find portable PDB on disk or embedded. PDB portable introuvable sur le disque ou incorporé. @@ -695,11 +685,6 @@ Veillez à utiliser le spécificateur "tt" pour les langues où il est nécessai Les méthodes d'enregistrement implémentées explicitement doivent avoir des noms de paramètres qui correspondent à l'équivalent « {0} » généré par le compilateur. - - Explicitly inherit documentation - Hériter explicitement de la documentation - - Extract base class... Extraire la classe de base... @@ -1045,16 +1030,6 @@ Veillez à utiliser le spécificateur "tt" pour les langues où il est nécessai JSON issue: {0} - - Make class 'abstract' - Rendre la classe 'abstract' - - - - Make static - Rendre statique - - Invert conditional Inverser un élément conditionnel @@ -2910,11 +2885,6 @@ Les assertions arrière positives de largeur nulle sont généralement utilisée Utiliser le corps d'expression pour les expressions lambda - - Use interpolated verbatim string - Utiliser une chaîne verbatim interpolée - - Value: Valeur : @@ -4890,11 +4860,6 @@ Version utilisée dans : {2} indexeur - - Alias ambiguous type '{0}' - Alias de type ambigu : '{0}' - - Warning: Collection was modified during iteration. Avertissement : La collection a été modifiée durant l'itération. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf index 455443fce332d..f4e7e08e57f10 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.it.xlf @@ -50,11 +50,6 @@ Assicurarsi di usare l'identificatore "tt" per le lingue per le quali è necessa Aggiungi l'attributo 'DebuggerDisplay' {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Aggiungi cast esplicito - - Add member name Aggiungi nome del membro @@ -570,11 +565,6 @@ Assicurarsi di usare l'identificatore "tt" per le lingue per le quali è necessa Converti in tupla - - Convert type to '{0}' - Converti il tipo in '{0}' - - Could not find portable PDB on disk or embedded. Impossibile trovare PDB portabile su disco o incorporato. @@ -695,11 +685,6 @@ Assicurarsi di usare l'identificatore "tt" per le lingue per le quali è necessa I metodi dei record implementati in modo esplicito devono avere nomi di parametro corrispondenti all'equivalente generato dal compilatore '{0}' - - Explicitly inherit documentation - Eredita esplicitamente la documentazione - - Extract base class... Estrai classe di base... @@ -1045,16 +1030,6 @@ Assicurarsi di usare l'identificatore "tt" per le lingue per le quali è necessa JSON issue: {0} - - Make class 'abstract' - Rendi la classe 'abstract' - - - - Make static - Imposta come statici - - Invert conditional Inverti espressione condizionale @@ -2910,11 +2885,6 @@ Le asserzioni lookbehind positive di larghezza zero vengono usate in genere all' Usa il corpo dell'espressione per le espressioni lambda - - Use interpolated verbatim string - Usa stringa verbatim interpolata - - Value: Valore: @@ -4890,11 +4860,6 @@ Questa versione è usata {2} indicizzatore - - Alias ambiguous type '{0}' - Tipo di alias '{0}' ambiguo - - Warning: Collection was modified during iteration. Avviso: la raccolta è stata modificata durante l'iterazione. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf index ea39b7008256a..321fb21e52af9 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ja.xlf @@ -50,11 +50,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 'DebuggerDisplay' 属性の追加 {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - 明示的なキャストの追加 - - Add member name メンバー名を追加します @@ -570,11 +565,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma タプルに変換 - - Convert type to '{0}' - 型を '{0}' に変換 - - Could not find portable PDB on disk or embedded. ポータブル PDB がディスクまたは埋め込みで見つかりませんでした。 @@ -695,11 +685,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 明示的に実装されたレコードのメソッドには、コンパイラ生成と同等の '{0}' と一致するパラメーター名が必要です - - Explicitly inherit documentation - ドキュメントを明示的に継承する - - Extract base class... 基底クラスの抽出... @@ -1045,16 +1030,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma JSON issue: {0} - - Make class 'abstract' - クラスを 'abstract' にしてください - - - - Make static - 静的にする - - Invert conditional 条件を反転します @@ -2910,11 +2885,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of ラムダ式に式本体を使用する - - Use interpolated verbatim string - 挿入された逐語的文字列を使用します - - Value: 値: @@ -4890,11 +4860,6 @@ This version used in: {2} インデクサー - - Alias ambiguous type '{0}' - エイリアスのあいまいな型 '{0}' - - Warning: Collection was modified during iteration. 警告: 反復処理中にコレクションが変更されました。 diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf index 65b3282185426..0dc2664e593fe 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ko.xlf @@ -50,11 +50,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 'DebuggerDisplay' 특성을 추가합니다. {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - 명시적 캐스트 추가 - - Add member name 멤버 이름 추가 @@ -570,11 +565,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 튜플로 변환 - - Convert type to '{0}' - 형식을 '{0}'(으)로 변환 - - Could not find portable PDB on disk or embedded. 디스크 또는 포함에서 이식 가능한 PDB를 찾을 수 없습니다. @@ -695,11 +685,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 명시적으로 구현된 레코드 메서드에는 컴파일러에서 생성된 것과 일치하는 매개 변수 이름 '{0}'이 있어야 합니다. - - Explicitly inherit documentation - 명시적으로 상속 문서 - - Extract base class... 기본 클래스 추출... @@ -1045,16 +1030,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma JSON issue: {0} - - Make class 'abstract' - 'abstract' 클래스 만들기 - - - - Make static - 정적으로 만들기 - - Invert conditional 조건 반전 @@ -2910,11 +2885,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of 람다 식에 식 본문 사용 - - Use interpolated verbatim string - 보간된 축자 문자열 사용 - - Value: 값: @@ -4890,11 +4860,6 @@ This version used in: {2} 인덱서 - - Alias ambiguous type '{0}' - 별칭 모호한 형식 '{0}' - - Warning: Collection was modified during iteration. 경고: 반복 중 컬렉션이 수정되었습니다. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf index 1b29d30dc64db..1546d752d724c 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.pl.xlf @@ -50,11 +50,6 @@ Pamiętaj, aby nie używać specyfikatora „tt” dla wszystkich języków, w k Dodaj atrybut "DebuggerDisplay" {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Dodaj rzutowanie jawne - - Add member name Dodaj nazwę składowej @@ -570,11 +565,6 @@ Pamiętaj, aby nie używać specyfikatora „tt” dla wszystkich języków, w k Konwertuj na spójną kolekcję - - Convert type to '{0}' - Konwertuj typ na „{0}” - - Could not find portable PDB on disk or embedded. Nie można odnaleźć przenośnego pliku PDB na dysku lub w trybie osadzonym. @@ -695,11 +685,6 @@ Pamiętaj, aby nie używać specyfikatora „tt” dla wszystkich języków, w k Jawnie zaimplementowane metody rekordów muszą mieć nazwy parametrów pasujące do wygenerowanego odpowiednika kompilatora "{0}" - - Explicitly inherit documentation - Wyraźnie dziedziczona dokumentacja - - Extract base class... Wyodrębnij klasę bazową... @@ -1045,16 +1030,6 @@ Pamiętaj, aby nie używać specyfikatora „tt” dla wszystkich języków, w k JSON issue: {0} - - Make class 'abstract' - Ustaw specyfikator „abstract” dla klasy - - - - Make static - Ustaw jako statyczne - - Invert conditional Odwróć warunkowe @@ -2910,11 +2885,6 @@ Pozytywne asercje wsteczne o zerowej szerokości są zwykle używane na początk Użyj treści wyrażenia dla wyrażeń lambda - - Use interpolated verbatim string - Użyj interpolowanego ciągu dosłownego wyrażenia - - Value: Wartość: @@ -4890,11 +4860,6 @@ Ta wersja jest używana wersja: {2} indeksator - - Alias ambiguous type '{0}' - Niejednoznaczny typ aliasu „{0}” - - Warning: Collection was modified during iteration. Ostrzeżenie: kolekcja została zmodyfikowana podczas iteracji. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf index 487b33031fcaf..37a14ce6d5b10 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.pt-BR.xlf @@ -50,11 +50,6 @@ Verifique se o especificador "tt" foi usado para idiomas para os quais é necess Adicionar atributo 'DebuggerDisplay' {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Adicionar conversão explícita - - Add member name Adicionar o nome do membro @@ -570,11 +565,6 @@ Verifique se o especificador "tt" foi usado para idiomas para os quais é necess Converter a tupla - - Convert type to '{0}' - Converter o tipo em '{0}' - - Could not find portable PDB on disk or embedded. Não foi possível encontrar PDB portátil no disco ou incorporado. @@ -695,11 +685,6 @@ Verifique se o especificador "tt" foi usado para idiomas para os quais é necess Métodos explicitamente implementados de registros devem ter nomes de parâmetro que correspondem ao compilador gerado '{0}' equivalente - - Explicitly inherit documentation - Herdar explicitamente a documentação - - Extract base class... Extrair a classe base... @@ -1045,16 +1030,6 @@ Verifique se o especificador "tt" foi usado para idiomas para os quais é necess JSON issue: {0} - - Make class 'abstract' - Tornar a classe 'abstract' - - - - Make static - Tornar estático - - Invert conditional Inverter condicional @@ -2910,11 +2885,6 @@ As declarações de lookbehind positivas de largura zero normalmente são usadas Usar corpo da expressão para expressões lambda - - Use interpolated verbatim string - Usar cadeia de caracteres verbatim interpolada - - Value: Valor: @@ -4890,11 +4860,6 @@ Essa versão é usada no: {2} indexador - - Alias ambiguous type '{0}' - Tipo de alias ambíguo '{0}' - - Warning: Collection was modified during iteration. Aviso: a coleção foi modificada durante a iteração. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf index 66948a7297ce7..cafaa827d9ff0 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.ru.xlf @@ -50,11 +50,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma Добавить атрибут "DebuggerDisplay" {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Добавить явное приведение - - Add member name Добавить имя элемента @@ -570,11 +565,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma Преобразовать в кортеж - - Convert type to '{0}' - Преобразовать тип в "{0}" - - Could not find portable PDB on disk or embedded. Не удалось найти переносимый PDB-файл на диске или во внедренном источнике. @@ -695,11 +685,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma Явно реализованные методы записей должны иметь имена параметров, соответствующие компилятору, созданному эквивалентом '{0}' - - Explicitly inherit documentation - Явно наследовать документацию - - Extract base class... Извлечь базовый класс... @@ -1045,16 +1030,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma JSON issue: {0} - - Make class 'abstract' - Сделать класс абстрактным - - - - Make static - Сделать статическим - - Invert conditional Инвертировать условный оператор @@ -2910,11 +2885,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of Использовать тело выражения для лямбда-выражений - - Use interpolated verbatim string - Использовать интерполированную буквальную строку - - Value: Значение: @@ -4890,11 +4860,6 @@ This version used in: {2} индексатор - - Alias ambiguous type '{0}' - Неоднозначный тип псевдонима "{0}" - - Warning: Collection was modified during iteration. Внимание! Коллекция изменена во время итерации. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf index d3018db78b3f1..6155cd516283b 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.tr.xlf @@ -50,11 +50,6 @@ AM ve PM arasındaki farkın korunmasının gerekli olduğu diller için "tt" be 'DebuggerDisplay' özniteliği ekle {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - Açık tür dönüştürme ekle - - Add member name Üye adı Ekle @@ -570,11 +565,6 @@ AM ve PM arasındaki farkın korunmasının gerekli olduğu diller için "tt" be Başlığa dönüştür - - Convert type to '{0}' - Türü '{0}' olarak dönüştür - - Could not find portable PDB on disk or embedded. Diskte veya gömülü olarak taşınabilir PDB bulunamadı. @@ -695,11 +685,6 @@ AM ve PM arasındaki farkın korunmasının gerekli olduğu diller için "tt" be Açık olarak uygulanan kayıt yöntemlerinin derleyici tarafından oluşturulan '{0}' eşdeğeri ile eşleşen parametre adlarına sahip olması gerekir - - Explicitly inherit documentation - Belgeleri açıkça devral - - Extract base class... Temel sınıfı ayıkla... @@ -1045,16 +1030,6 @@ AM ve PM arasındaki farkın korunmasının gerekli olduğu diller için "tt" be JSON issue: {0} - - Make class 'abstract' - Sınıfı 'abstract' yap - - - - Make static - Statik yap - - Invert conditional Koşullu öğeyi ters çevir @@ -2910,11 +2885,6 @@ Sıfır genişlikli pozitif geri yönlü onaylamalar genellikle normal ifadeleri Lambda ifadeleri için ifade vücut kullanımı - - Use interpolated verbatim string - Enterpolasyonlu kelimesi kelimesine dizeyi kullanın - - Value: Değer: @@ -4890,11 +4860,6 @@ Bu sürüm şurada kullanılır: {2} dizin oluşturucu - - Alias ambiguous type '{0}' - Diğer ad belirsiz '{0}' türünde - - Warning: Collection was modified during iteration. Uyarı: Yineleme sırasında koleksiyon değiştirildi. diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf index a0c4ec25789a1..6bda647863b68 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hans.xlf @@ -50,11 +50,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 添加 "DebuggerDisplay" 属性 {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - 添加显式转换 - - Add member name 添加成员名称 @@ -570,11 +565,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 转换为元组 - - Convert type to '{0}' - 将类型转换为“{0}” - - Could not find portable PDB on disk or embedded. 在磁盘或嵌入源上找不到可移植 PDB。 @@ -695,11 +685,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 记录的显示实施方法参数名必须匹配编辑器生成的等效“{0}” - - Explicitly inherit documentation - 显式继承文档 - - Extract base class... 提取基类... @@ -1045,16 +1030,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma JSON issue: {0} - - Make class 'abstract' - 将类设置为 "abstract" - - - - Make static - 设为静态 - - Invert conditional 反转条件 @@ -2910,11 +2885,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of 对 lambda 表达式使用表达式正文 - - Use interpolated verbatim string - 使用内插的逐字字符串 - - Value: 值: @@ -4890,11 +4860,6 @@ This version used in: {2} 索引器 - - Alias ambiguous type '{0}' - 别名多义类型“{0}” - - Warning: Collection was modified during iteration. 警告: 迭代期间已修改集合。 diff --git a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf index b99c88ed17b96..749e2f38be94f 100644 --- a/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf +++ b/src/Features/Core/Portable/xlf/FeaturesResources.zh-Hant.xlf @@ -50,11 +50,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 新增 'DebuggerDisplay' 屬性 {Locked="DebuggerDisplay"} "DebuggerDisplay" is a BCL class and should not be localized. - - Add explicit cast - 新增明確轉換 - - Add member name 新增成員名稱 @@ -570,11 +565,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 轉換為元組 - - Convert type to '{0}' - 將類型轉換為 '{0}' - - Could not find portable PDB on disk or embedded. 磁碟或內嵌上找不到可攜式 PDB。 @@ -695,11 +685,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma 記錄的明確實作方法,必須有參數名稱符合編譯器產生的相等 '{0}' - - Explicitly inherit documentation - 明確繼承文件 - - Extract base class... 擷取基底類別... @@ -1045,16 +1030,6 @@ Make sure to use the "tt" specifier for languages for which it's necessary to ma JSON issue: {0} - - Make class 'abstract' - 將類別設為 'abstract' - - - - Make static - 使其變成靜態 - - Invert conditional 反轉條件 @@ -2910,11 +2885,6 @@ Zero-width positive lookbehind assertions are typically used at the beginning of 使用 Lambda 運算式的運算式主體 - - Use interpolated verbatim string - 使用插入的逐字字串 - - Value: 值: @@ -4890,11 +4860,6 @@ This version used in: {2} 索引子 - - Alias ambiguous type '{0}' - 別名不明確類型 '{0}' - - Warning: Collection was modified during iteration. 警告: 集合已於反覆運算期間被修改 diff --git a/src/Features/VisualBasic/Portable/VBFeaturesResources.resx b/src/Features/VisualBasic/Portable/VBFeaturesResources.resx index 1dcbc463afa9d..6401f8be7bef7 100644 --- a/src/Features/VisualBasic/Portable/VBFeaturesResources.resx +++ b/src/Features/VisualBasic/Portable/VBFeaturesResources.resx @@ -962,12 +962,6 @@ Sub(<parameterList>) <statement> Make {0} an Async Function. - - Convert {0} to Iterator - - - Replace 'Return' with 'Yield - Use the correct control variable @@ -1207,9 +1201,6 @@ Sub(<parameterList>) <statement> Convert to 'For' - - Add <Obsolete> - Add missing Imports {Locked="Import"} @@ -1222,9 +1213,6 @@ Sub(<parameterList>) <statement> Introduce 'Using' statement {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Apply Me qualification preferences {Locked="Me"} "Me" is a VB keyword and should not be localized. diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf index d2e2a67c7f45f..f6e4557c7e016 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.cs.xlf @@ -12,11 +12,6 @@ Přidat Await a ConfigureAwait(false) - - Add <Obsolete> - Přidat <Obsolete> - - Add missing Imports Přidat chybějící Importy @@ -97,11 +92,6 @@ Zavést příkaz Using {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Nastavit dědičnost pro {0} - - Make private field ReadOnly when possible Pokud je to možné, nastavit privátní pole jako ReadOnly @@ -1502,16 +1492,6 @@ Sub(<seznam_parametrů>) <výraz> Převeď {0} na asynchronní funkci Async. - - Convert {0} to Iterator - Převést {0} na iterátor - - - - Replace 'Return' with 'Yield - Nahradit příkaz Return příkazem Yield - - Use the correct control variable Použít správnou řídicí proměnnou diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf index ad3347120f439..7a3e6e359856b 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.de.xlf @@ -12,11 +12,6 @@ "Await" und "ConfigureAwait(false)" hinzufügen - - Add <Obsolete> - <Veraltet> hinzufügen - - Add missing Imports Fehlende Importe hinzufügen @@ -97,11 +92,6 @@ Using-Anweisung einführen {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - "{0}" als vererbbar festlegen - - Make private field ReadOnly when possible Privates Feld nach Möglichkeit als "ReadOnly" festlegen @@ -1502,16 +1492,6 @@ Sub(<Parameterliste>) <Ausdruck> "{0}" in eine Async-Funktion umwandeln. - - Convert {0} to Iterator - {0} in Iterator konvertieren - - - - Replace 'Return' with 'Yield - "Return" durch "Yield" ersetzen - - Use the correct control variable Richtige Steuervariable verwenden diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf index 07a349d500ac5..58e9346e68928 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.es.xlf @@ -12,11 +12,6 @@ Agregar await y "ConfigureAwait(false)" - - Add <Obsolete> - Agregar <obsoleto> - - Add missing Imports Agregar instancias de Import que faltan @@ -97,11 +92,6 @@ Introducir instrucción "Using" {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Hacer "{0}" heredable - - Make private field ReadOnly when possible Hacer que el campo privado sea ReadOnly cuando sea posible @@ -1502,16 +1492,6 @@ Sub(<listaDeParámetros>) <instrucción>wo laopo fuke Convertir {0} en una función Async. - - Convert {0} to Iterator - Convertir {0} en Iterador - - - - Replace 'Return' with 'Yield - Reemplazar "Return" por "Yield - - Use the correct control variable Utilizar la variable de control correcta diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf index a78971dde3458..91fb24b0c5606 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.fr.xlf @@ -12,11 +12,6 @@ Ajouter Await et 'ConfigureAwait(false)' - - Add <Obsolete> - Ajouter <Obsolete> - - Add missing Imports Ajouter les Import manquants @@ -97,11 +92,6 @@ Introduire l'instruction 'Using' {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Rendre '{0}' héritable - - Make private field ReadOnly when possible Rendre le champ privé ReadOnly quand cela est possible @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> Faire de {0} une fonction Async. - - Convert {0} to Iterator - Convertir {0} en itérateur - - - - Replace 'Return' with 'Yield - Remplacer 'Return' par 'Yield - - Use the correct control variable Utiliser la variable de contrôle correcte diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf index b4e6165ea2dd0..580c90ca4e2f2 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.it.xlf @@ -12,11 +12,6 @@ Aggiungi Await a 'ConfigureAwait(false)' - - Add <Obsolete> - Aggiungi <Obsolete> - - Add missing Imports Aggiungi Import mancanti @@ -97,11 +92,6 @@ Introduci istruzioni 'Using' {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Imposta '{0}' come ereditabile - - Make private field ReadOnly when possible Imposta il campo privato come ReadOnly quando possibile @@ -1502,16 +1492,6 @@ Sub(<elencoParametri>) <istruzione> Trasformare {0} in una funzione asincrona. - - Convert {0} to Iterator - Converti {0} in iteratore - - - - Replace 'Return' with 'Yield - Sostituisci 'Return' con 'Yield' - - Use the correct control variable Usa la variabile di controllo corretta diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf index 5ed260cb3630e..426bf77248393 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ja.xlf @@ -12,11 +12,6 @@ Await と 'ConfigureAwait(false)' の追加 - - Add <Obsolete> - <Obsolete> の追加 - - Add missing Imports 欠落している Import の追加 @@ -97,11 +92,6 @@ ’Using’ ステートメントの導入 {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - '{0}' を継承可能にします - - Make private field ReadOnly when possible 可能な場合、プライベート フィールドを ReadOnly にする @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> {0} を Async Function にします。 - - Convert {0} to Iterator - {0} を反復子に変換 - - - - Replace 'Return' with 'Yield - Return' を 'Yield' に置き換える - - Use the correct control variable 正しい制御変数を使用する diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf index 40af68794a182..4110a392c769e 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ko.xlf @@ -12,11 +12,6 @@ Await 및 'ConfigureAwait(false)' 추가 - - Add <Obsolete> - <Obsolete> 추가 - - Add missing Imports 누락된 Imports 추가 @@ -97,11 +92,6 @@ 'Using' 문 지정 {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - '{0}'을(를) 상속 가능으로 지정 - - Make private field ReadOnly when possible 가능한 경우 프라이빗 필드를 ReadOnly로 만들기 @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> {0}을(를) 비동기 함수로 설정합니다. - - Convert {0} to Iterator - 반복기로 {0} 변환 - - - - Replace 'Return' with 'Yield - Return'을 'Yield'로 바꾸기 - - Use the correct control variable 올바른 제어 변수 사용 diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf index 39329a5c74db4..5af7bb87b27bf 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pl.xlf @@ -12,11 +12,6 @@ Dodaj operator Await i wywołanie „ConfigureAwait(false)” - - Add <Obsolete> - Dodaj oznaczenie <Obsolete> - - Add missing Imports Dodaj brakujące instrukcje Imports @@ -97,11 +92,6 @@ Wprowadź instrukcję „Using” {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Ustaw element „{0}” jako dziedziczony - - Make private field ReadOnly when possible Ustaw pole prywatne jako ReadOnly, gdy to możliwe @@ -1502,16 +1492,6 @@ Sub(<listaParametrów>) <instrukcja> Ustaw funkcję {0} jako funkcję asynchroniczną. - - Convert {0} to Iterator - Konwertuj element {0} na iterator - - - - Replace 'Return' with 'Yield - Zamień instrukcję „Return” na instrukcję „Yield” - - Use the correct control variable Użyj poprawnej zmiennej sterującej diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf index 960458d1bff70..514993ed05af8 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.pt-BR.xlf @@ -12,11 +12,6 @@ Adicionar Await e 'ConfigureAwait(false)' - - Add <Obsolete> - Adicionar <Obsolete> - - Add missing Imports Adicionar Importações ausentes @@ -97,11 +92,6 @@ Apresente a instrução 'Using' {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Alterar '{0}' para herdável - - Make private field ReadOnly when possible Fazer com que o campo privado seja ReadOnly quando possível @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> Tornar {0} uma Função Assíncrona. - - Convert {0} to Iterator - Converter {0} para Iterador - - - - Replace 'Return' with 'Yield - Substituir "Return" por "Yield" - - Use the correct control variable Usar a variável de controle correta diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf index 7dbd767442ed9..dba4fcffec49b 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.ru.xlf @@ -12,11 +12,6 @@ Добавить Await и "ConfigureAwait(false)" - - Add <Obsolete> - Добавить <Obsolete> - - Add missing Imports Добавить отсутствующий оператор Imports @@ -97,11 +92,6 @@ Ввести оператор "Using" {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - Сделать "{0}" наследуемым - - Make private field ReadOnly when possible Сделать закрытое поле доступным для чтения (ReadOnly), если это возможно @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> Сделать {0} асинхронной функцией. - - Convert {0} to Iterator - Преобразовать {0} в итератор - - - - Replace 'Return' with 'Yield - Замените "Return" на "Yield - - Use the correct control variable Используйте правильную переменную элемента управления diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf index 268ada03192eb..abf4d30bbea34 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.tr.xlf @@ -12,11 +12,6 @@ Await ve 'ConfigureAwait(false)' ekle - - Add <Obsolete> - <Obsolete> ekle - - Add missing Imports Eksik Import'ları ekle @@ -97,11 +92,6 @@ 'Using' deyimi ekle {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - '{0}' öğesini devralınabilir hale getir - - Make private field ReadOnly when possible Mümkün olduğunda özel alanı ReadOnly yap @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> {0} öğesini bir Zaman Uyumsuz İşlev yap. - - Convert {0} to Iterator - {0} öğesini Yineleyici'ye dönüştür - - - - Replace 'Return' with 'Yield - Return' değerini 'Yield' ile değiştir - - Use the correct control variable Doğru denetim değişkenini kullanın diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf index 7a4acca09dff7..0a6736f2ace75 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hans.xlf @@ -12,11 +12,6 @@ 添加 Await 和 “ConfigureAwait(false)” - - Add <Obsolete> - 添加 <Obsolete> - - Add missing Imports 添加缺少的 Import @@ -97,11 +92,6 @@ 引入 “Using” 语句 {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - 使 "{0}" 可继承 - - Make private field ReadOnly when possible 尽可能将私有字段设为 ReadOnly @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> 使 {0} 为异步函数。 - - Convert {0} to Iterator - 将{0}转换为迭代器 - - - - Replace 'Return' with 'Yield - 将 "Return" 替换为 "Yield - - Use the correct control variable 使用正确的控制变量 diff --git a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf index a7e38ee503a33..ed4a839652931 100644 --- a/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf +++ b/src/Features/VisualBasic/Portable/xlf/VBFeaturesResources.zh-Hant.xlf @@ -12,11 +12,6 @@ 新增 Await 及 'ConfigureAwait(false)' - - Add <Obsolete> - 新增 <已淘汰> - - Add missing Imports 新增缺少的 Import @@ -97,11 +92,6 @@ 引入 'Using' 陳述式 {Locked="Using"} "Using" is a VB keyword and should not be localized. - - Make '{0}' inheritable - 將 '{0}' 設為可繼承 - - Make private field ReadOnly when possible 盡可能地將私人欄位設為 ReadOnly @@ -1502,16 +1492,6 @@ Sub(<parameterList>) <statement> 讓 {0} 成為非同步函式。 - - Convert {0} to Iterator - 將 {0} 轉換為 Iterator - - - - Replace 'Return' with 'Yield - 以 'Yield' 取代 'Return' - - Use the correct control variable 使用正確的控制變數 diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs deleted file mode 100644 index e69f2ba59a96f..0000000000000 --- a/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using Roslyn.Utilities; - -namespace Microsoft.CodeAnalysis.Shared.Extensions -{ - internal static class IListExtensions - { - public static int IndexOf(this IList list, Func predicate) - { - Contract.ThrowIfNull(list); - Contract.ThrowIfNull(predicate); - - for (var i = 0; i < list.Count; i++) - { - if (predicate(list[i])) - { - return i; - } - } - - return -1; - } - } -} diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs index 816b43f8e4ad7..dfd06aa29ec10 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs @@ -55,27 +55,6 @@ public static bool CompatibleSignatureToDelegate(this IMethodSymbol method, INam return true; } - /// - /// Returns the methodSymbol and any partial parts. - /// - public static ImmutableArray GetAllMethodSymbolsOfPartialParts(this IMethodSymbol method) - { - if (method.PartialDefinitionPart != null) - { - Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); - return ImmutableArray.Create(method, method.PartialDefinitionPart); - } - else if (method.PartialImplementationPart != null) - { - Debug.Assert(!Equals(method.PartialImplementationPart, method)); - return ImmutableArray.Create(method.PartialImplementationPart, method); - } - else - { - return ImmutableArray.Create(method); - } - } - public static IMethodSymbol RenameTypeParameters(this IMethodSymbol method, ImmutableArray newNames) { if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs index 5071112465fb2..abf45b793acf9 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs @@ -25,17 +25,6 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class ISymbolExtensions { - public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol) - { - return new DeclarationModifiers( - isStatic: symbol.IsStatic, - isAbstract: symbol.IsAbstract, - isUnsafe: symbol.RequiresUnsafeModifier(), - isVirtual: symbol.IsVirtual, - isOverride: symbol.IsOverride, - isSealed: symbol.IsSealed); - } - /// /// Checks a given symbol for browsability based on its declaration location, attributes /// explicitly limiting browsability, and whether showing of advanced members is enabled. diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs index 1ceb1db50bb73..84e5de00012ef 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs @@ -16,24 +16,6 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class SourceTextExtensions { - /// - /// Returns the leading whitespace of the line located at the specified position in the given snapshot. - /// - public static string GetLeadingWhitespaceOfLineAtPosition(this SourceText text, int position) - { - Contract.ThrowIfNull(text); - - var line = text.Lines.GetLineFromPosition(position); - var linePosition = line.GetFirstNonWhitespacePosition(); - if (!linePosition.HasValue) - { - return line.ToString(); - } - - var lineText = line.ToString(); - return lineText.Substring(0, linePosition.Value - line.Start); - } - public static void GetLineAndOffset(this SourceText text, int position, out int lineNumber, out int offset) { var line = text.Lines.GetLineFromPosition(position); diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.resx b/src/Workspaces/Core/Portable/WorkspacesResources.resx index 06deb5218f886..15180f35cddfa 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.resx +++ b/src/Workspaces/Core/Portable/WorkspacesResources.resx @@ -129,36 +129,9 @@ Cycle detected in extensions - - Destination type must be a {0}, but given one is {1}. - - - Destination type must be a {0} or a {1}, but given one is {2}. - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - Could not find location to generation symbol into. - - - No location provided to add statements to. - - - Destination location was not in source. - - - Destination location was from a different tree. - Node is of the wrong type. - - Location must be null or from source. - Duplicate source file '{0}' in project '{1}' @@ -309,12 +282,6 @@ Cannot generate code for unsupported operator '{0}' - - Invalid number of parameters for binary operator. - - - Invalid number of parameters for unary operator. - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf index 778c4b26985b7..976b6bf7c4770 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf @@ -52,11 +52,6 @@ DateTimeKind musí být Utc - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Cílový typ musí být {0}, {1}, {2} nebo {3}, ale zadaný typ je {4}. - - Document does not support syntax trees Dokument nepodporuje stromy syntaxe. @@ -137,51 +132,11 @@ V rozšířeních se zjistil cyklus. - - Destination type must be a {0}, but given one is {1}. - Cílový typ musí být {0}, ale zadaný typ je {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Cílový typ musí být {0} nebo {1}, ale zadaný typ je {2}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Cílový typ musí být {0}, {1} nebo {2}, ale zadaný typ je {3}. - - - - Could not find location to generation symbol into. - Nenašlo se umístění, do kterého by se vygeneroval symbol. - - - - No location provided to add statements to. - Není zadané žádné umístění, kam by se daly přidávat příkazy. - - - - Destination location was not in source. - Cílové umístění není ve zdroji. - - - - Destination location was from a different tree. - Cílové umístění pochází z jiného stromu. - - Node is of the wrong type. Uzel je chybného typu. - - Location must be null or from source. - Umístění musí být null nebo ze zdroje. - - Duplicate source file '{0}' in project '{1}' Duplicitní zdrojový soubor {0} v projektu {1} @@ -452,16 +407,6 @@ Nejde generovat kód pro nepodporovaný operátor {0}. - - Invalid number of parameters for binary operator. - Neplatný počet parametrů pro binární operátor - - - - Invalid number of parameters for unary operator. - Neplatný počet parametrů pro unární operátor - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Nejde otevřít projekt {0}, protože přípona souboru {1} není přidružená k jazyku. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf index 3b33ebc674923..a4f8bf615ef1a 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf @@ -52,11 +52,6 @@ "DateTimeKind" muss UTC sein. - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Der Zieltyp muss "{0}", "{1}", "{2}" oder "{3}" lauten. Es wurde jedoch "{4}" angegeben. - - Document does not support syntax trees Das Dokument unterstützt keine Syntaxstrukturen. @@ -137,51 +132,11 @@ Zyklus in Erweiterungen entdeckt - - Destination type must be a {0}, but given one is {1}. - Zieltyp muss {0} sein. Es wurde jedoch {1} angegeben. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Zieltyp muss {0} oder {1} sein. Es wurde jedoch {2} angegeben. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Zieltyp muss {0}, {1} oder {2} sein. Es wurde jedoch {3} angegeben. - - - - Could not find location to generation symbol into. - Konnte keinen Ort finden, in den das Symbol generiert werden kann. - - - - No location provided to add statements to. - Kein Ort angegeben, zu dem Anweisungen hinzugefügt werden. - - - - Destination location was not in source. - Zielort war nicht in Quelle. - - - - Destination location was from a different tree. - Zielort stammt aus anderem Baum. - - Node is of the wrong type. Knoten hat den falschen Typ. - - Location must be null or from source. - Ort muss null oder von Quelle sein. - - Duplicate source file '{0}' in project '{1}' Doppelte Quelldatei "{0}" in Projekt "{1}" @@ -452,16 +407,6 @@ Kann keinen Code für nicht unterstützten Operator "{0}" generieren - - Invalid number of parameters for binary operator. - Ungültige Parameteranzahl für binären Operator. - - - - Invalid number of parameters for unary operator. - Ungültige Parameteranzahl für unären Operator. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Projekt "{0}" kann nicht geöffnet werden, da die Dateierweiterung "{1}" keiner Sprache zugeordnet ist. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf index 28f0516522f55..c476ae51972df 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf @@ -52,11 +52,6 @@ DateTimeKind debe ser Utc - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - El tipo de destino debe ser una instancia de {0}, {1}, {2} o {3}, pero el proporcionado es {4}. - - Document does not support syntax trees El documento no admite árboles de sintaxis @@ -137,51 +132,11 @@ Detectado ciclo en extensiones - - Destination type must be a {0}, but given one is {1}. - El tipo de destino debe ser un {0}, pero el proporcionado es {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - El tipo de destino debe ser un {0} o un {1}, pero el proporcionado es {2}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - El tipo de destino debe ser un {0}, {1} o {2}, pero el proporcionado es {3}. - - - - Could not find location to generation symbol into. - No se pudo encontrar una ubicación en la que generar un símbolo. - - - - No location provided to add statements to. - No se ha proporcionado ubicación a la que agregar instrucciones. - - - - Destination location was not in source. - La ubicación de destino no estaba en el código fuente. - - - - Destination location was from a different tree. - La ubicación de destino era de otro árbol. - - Node is of the wrong type. El nodo es del tipo erróneo. - - Location must be null or from source. - La ubicación debe ser null o del código fuente. - - Duplicate source file '{0}' in project '{1}' Archivo de código fuente '{0}' duplicado en el proyecto '{1}' @@ -452,16 +407,6 @@ No se puede generar código para el operador no compatible '{0}' - - Invalid number of parameters for binary operator. - Número de parámetros no válido para el operador binario. - - - - Invalid number of parameters for unary operator. - Número de parámetros no válido para el operador unario. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. No se puede abrir el proyecto '{0}' porque la extensión de archivo '{1}' no está asociada a un lenguaje. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf index b28c49f5e07d0..198c24f7a56c4 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf @@ -52,11 +52,6 @@ DateTimeKind doit être UTC - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Le type de destination doit être {0}, {1}, {2} ou {3}, mais le type spécifié est {4}. - - Document does not support syntax trees Le document ne prend pas en charge les arborescences de syntaxe @@ -137,51 +132,11 @@ Cycle détecté dans les extensions - - Destination type must be a {0}, but given one is {1}. - Le type de destination doit être un {0}, mais le type donné est {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Le type de destination doit être un {0} ou un {1}, mais le type donné est {2}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Le type de destination doit être un {0}, {1} ou {2}, mais le type donné est {3}. - - - - Could not find location to generation symbol into. - L'emplacement dans lequel générer le symbole est introuvable. - - - - No location provided to add statements to. - Aucun emplacement n'a été fourni pour l'ajout d'instructions. - - - - Destination location was not in source. - L'emplacement de destination n'était pas dans la source. - - - - Destination location was from a different tree. - L'emplacement de destination provient d'une arborescence différente. - - Node is of the wrong type. Le type de nœud est incorrect. - - Location must be null or from source. - L'emplacement doit être null ou dans la source. - - Duplicate source file '{0}' in project '{1}' Dupliquer le fichier source '{0}' dans le projet '{1}' @@ -452,16 +407,6 @@ Impossible de générer du code pour l'opérateur non pris en charge '{0}' - - Invalid number of parameters for binary operator. - Nombre de paramètres non valide pour l'opérateur binaire. - - - - Invalid number of parameters for unary operator. - Nombre de paramètres non valide pour l'opérateur unaire. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Impossible d'ouvrir le projet '{0}', car l'extension de fichier '{1}' n'est pas associée à un langage. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf index 833722dc62843..6c08647a92158 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf @@ -52,11 +52,6 @@ Il valore di DateTimeKind deve essere Utc - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Il tipo di destinazione deve essere {0}, {1}, {2} o {3}, ma quello specificato è {4}. - - Document does not support syntax trees Il documento non supporta alberi di sintassi @@ -137,51 +132,11 @@ È stato rilevato un ciclo nelle estensioni - - Destination type must be a {0}, but given one is {1}. - Il tipo di destinazione deve essere {0}, ma quello specificato è {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Il tipo di destinazione deve essere {0} o {1}, ma quello specificato è {2}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Il tipo di destinazione deve essere {0}, {1} o {2}, ma quello specificato è {3}. - - - - Could not find location to generation symbol into. - Non è stata trovata la posizione in cui generare il simbolo. - - - - No location provided to add statements to. - Non sono state specificate posizioni in cui aggiungere istruzioni. - - - - Destination location was not in source. - La posizione di destinazione non è inclusa nell'origine. - - - - Destination location was from a different tree. - La posizione di destinazione è in un albero diverso. - - Node is of the wrong type. Il tipo del nodo è errato. - - Location must be null or from source. - La posizione deve essere Null o derivare dall'origine. - - Duplicate source file '{0}' in project '{1}' File di origine '{0}' duplicato nel progetto '{1}' @@ -452,16 +407,6 @@ Non è possibile generare il codice per l'operatore '{0}' non supportato - - Invalid number of parameters for binary operator. - Il numero di parametri per l'operatore binario non è valido. - - - - Invalid number of parameters for unary operator. - Il numero di parametri per l'operatore unario non è valido. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Non è possibile aprire il progetto '{0}' perché l'estensione di file '{1}' non è associata a un linguaggio. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf index 055f08def46cc..1d5921e0ca513 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf @@ -52,11 +52,6 @@ DateTimeKind は Utc にする必要があります - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - ターゲットの型は {0}、{1}、{2}、または {3} である必要がありますが、{4} が指定されています。 - - Document does not support syntax trees ドキュメントでは構文ツリーがサポートされません @@ -137,51 +132,11 @@ 拡張機能で循環が検出されました - - Destination type must be a {0}, but given one is {1}. - ターゲットの型は {0} である必要がありますが、{1} が指定されています。 - - - - Destination type must be a {0} or a {1}, but given one is {2}. - ターゲットの型は {0} または {1} である必要がありますが、{2} が指定されています。 - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - ターゲットの型は {0}、{1}、または {2} である必要がありますが、{3} が指定されています。 - - - - Could not find location to generation symbol into. - シンボルの生成先が見つかりませんでした。 - - - - No location provided to add statements to. - ステートメントを追加する場所がありません。 - - - - Destination location was not in source. - 追加先の場所は、ソース内ではありません。 - - - - Destination location was from a different tree. - ターゲットの場所は、別のツリーでした。 - - Node is of the wrong type. ノードの種類が正しくありません。 - - Location must be null or from source. - 場所は Null であるか、ソースからでなければなりません。 - - Duplicate source file '{0}' in project '{1}' プロジェクト '{1}' でソース ファイル '{0}' が重複しています @@ -452,16 +407,6 @@ サポートされない演算子 '{0}' のコードは生成できません - - Invalid number of parameters for binary operator. - 二項演算子のパラメーターの数が無効です。 - - - - Invalid number of parameters for unary operator. - 単項演算子のパラメーターの数が無効です。 - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. ファイルの拡張子 '{1}' が言語に関連付けられていないため、プロジェクト '{0}' を開くことができません。 diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf index 27fe20e964e11..9d973075e113c 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf @@ -52,11 +52,6 @@ DateTimeKind는 UTC여야 합니다. - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - 대상 형식은 {0}, {1}, {2} 또는 {3}이어야 하지만 지정된 대상 형식은 {4}입니다. - - Document does not support syntax trees 문서가 구문 트리를 지원하지 않음 @@ -137,51 +132,11 @@ 확장에서 순환 발견 - - Destination type must be a {0}, but given one is {1}. - 대상 형식은 {0}이어야 하지만 지정된 형식은 {1}입니다. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - 대상 형식은 {0} 또는 {1}이어야 하지만 지정된 형식은 {2}입니다. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - 대상 형식은 {0}, {1} 또는 {2}이어야 하지만 지정된 형식은 {3}입니다. - - - - Could not find location to generation symbol into. - 기호를 생성할 위치를 찾을 수 없습니다. - - - - No location provided to add statements to. - 문을 추가할 위치가 제공되지 않았습니다. - - - - Destination location was not in source. - 대상 위치가 소스에 없습니다. - - - - Destination location was from a different tree. - 다른 트리에서 온 대상 위치입니다. - - Node is of the wrong type. 잘못된 형식의 노드입니다. - - Location must be null or from source. - 위치는 null이거나 소스에 있어야 합니다. - - Duplicate source file '{0}' in project '{1}' '{1}' 프로젝트에서 중복된 '{0}' 소스 파일입니다. @@ -452,16 +407,6 @@ 지원되지 않는 '{0}' 연산자에 대한 코드를 생성할 수 없습니다. - - Invalid number of parameters for binary operator. - 이진 연산자에 대해 잘못된 매개 변수 수입니다. - - - - Invalid number of parameters for unary operator. - 단항 연산자에 대해 잘못된 매개 변수 수입니다. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. '{1}' 파일 확장명이 언어에 연결되어 있지 않아 '{0}' 프로젝트를 열 수 없습니다. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf index bf6c1799e126d..f29f635432c97 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf @@ -52,11 +52,6 @@ Element DateTimeKind musi mieć wartość Utc - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Typ docelowy musi być elementem {0}, {1}, {2} lub {3}, ale podano element {4}. - - Document does not support syntax trees Dokument nie obsługuje drzew składni @@ -137,51 +132,11 @@ W rozszerzeniach wykryto cykl - - Destination type must be a {0}, but given one is {1}. - Typ docelowy musi być elementem {0}, ale podano element {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Typ docelowy musi być elementem {0} lub {1}, ale podano element {2}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Typ docelowy musi być elementem {0}, {1} lub {2}, ale podano element {3}. - - - - Could not find location to generation symbol into. - Nie można znaleźć lokalizacji do wygenerowania symbolu. - - - - No location provided to add statements to. - Nie podano lokalizacji, do których można dodać instrukcje. - - - - Destination location was not in source. - Lokalizacja docelowa nie znajdowała się w źródle. - - - - Destination location was from a different tree. - Lokalizacja docelowa pochodziła z innego drzewa. - - Node is of the wrong type. Węzeł ma nieprawidłowy typ. - - Location must be null or from source. - Lokalizacja musi mieć wartość null lub pochodzić ze źródła. - - Duplicate source file '{0}' in project '{1}' Zduplikowany plik źródłowy „{0}” w projekcie „{1}” @@ -452,16 +407,6 @@ Nie można wygenerować kodu dla nieobsługiwanego operatora „{0}” - - Invalid number of parameters for binary operator. - Nieprawidłowa liczba parametrów operatora binarnego. - - - - Invalid number of parameters for unary operator. - Nieprawidłowa liczba parametrów operatora jednoargumentowego. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Nie można otworzyć projektu „{0}”, ponieważ rozszerzenie pliku „{1}” nie jest skojarzone z językiem. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf index 4079e600970ba..0debb02a468f1 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf @@ -52,11 +52,6 @@ DateTimeKind deve ser Utc - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - O tipo de destino precisa ser {0}, {1}, {2} ou {3}, mas o tipo fornecido é {4}. - - Document does not support syntax trees O documento não dá suporte a árvores de sintaxe @@ -137,51 +132,11 @@ Ciclo detectado em extensões - - Destination type must be a {0}, but given one is {1}. - O tipo de destino deve ser um {0}, mas o tipo fornecido é {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - O tipo de destino deve ser um {0} ou um {1}, mas o tipo fornecido é {2}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - O tipo de destino deve ser um {0}, {1} ou {2}, mas o tipo fornecido é {3}. - - - - Could not find location to generation symbol into. - Não foi possível encontrar o local para o símbolo de geração. - - - - No location provided to add statements to. - Nenhum local fornecido para o qual adicionar instruções. - - - - Destination location was not in source. - Local de destino não estava na origem. - - - - Destination location was from a different tree. - Local de destino era de uma árvore diferente. - - Node is of the wrong type. O nó é do tipo errado. - - Location must be null or from source. - Local deve ser nulo ou da fonte. - - Duplicate source file '{0}' in project '{1}' Arquivo de origem duplicado "{0}" no projeto "{1}" @@ -452,16 +407,6 @@ Não é possível gerar código para operador não suportado "{0}" - - Invalid number of parameters for binary operator. - Número inválido de parâmetros para o operador binário. - - - - Invalid number of parameters for unary operator. - Número inválido de parâmetros para o operador unário. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Não é possível abrir o projeto "{0}" porque a extensão de arquivo "{1}" não está associada a um idioma. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf index f84d7e5a5fce0..a15d12cd10569 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf @@ -52,11 +52,6 @@ Параметр DateTimeKind должен содержать время и дату в формате UTC - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Конечный тип должен быть {0}, {1}, {2} или {3}, но указан {4}. - - Document does not support syntax trees Документ не поддерживает синтаксические деревья. @@ -137,51 +132,11 @@ В выражениях обнаружен цикл - - Destination type must be a {0}, but given one is {1}. - Конечный тип должен быть {0}, но указан {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Конечный тип должен быть {0} или {1}, но указан {2}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Конечный тип должен быть {0}, {1} или {2}, но указан {3}. - - - - Could not find location to generation symbol into. - Не удалось найти расположение для создания символа. - - - - No location provided to add statements to. - Для добавления операторов не было указано расположение. - - - - Destination location was not in source. - Целевое расположение не найдено в источнике. - - - - Destination location was from a different tree. - Целевое расположение находилось в другом дереве. - - Node is of the wrong type. Узел имеет неверный тип. - - Location must be null or from source. - Расположение должно иметь значение Null или источника. - - Duplicate source file '{0}' in project '{1}' Дублирование исходного файла "{0}" в проекте "{1}" @@ -452,16 +407,6 @@ Невозможно сформировать код для неподдерживаемого оператора "{0}" - - Invalid number of parameters for binary operator. - Недопустимое число параметров для бинарного оператора. - - - - Invalid number of parameters for unary operator. - Недопустимое число параметров для унарного оператора. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Не удается открыть проект "{0}", так как расширение файла "{1}" не связано с языком. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf index 134a34cbdb11b..2e6aea73cea58 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf @@ -52,11 +52,6 @@ DateTimeKind Utc olmalıdır - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Hedef tür bir {0}, {1}, {2} veya {3} olmalı, ancak {4} belirtildi. - - Document does not support syntax trees Belge, söz dizimi ağaçlarını desteklemiyor @@ -137,51 +132,11 @@ Uzantılarda döngü algılandı - - Destination type must be a {0}, but given one is {1}. - Hedef tür bir {0} olmalı, ancak {1} belirtildi. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Hedef tür bir {0} veya {1} olmalı, ancak {2} belirtildi. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Hedef tür bir {0}, {1} veya {2} olmalı, ancak {3} belirtildi. - - - - Could not find location to generation symbol into. - Sembolün üretileceği konum bulunamadı. - - - - No location provided to add statements to. - Deyimlerin ekleneceği konum sağlanmadı. - - - - Destination location was not in source. - Hedef konum kaynakta değildi. - - - - Destination location was from a different tree. - Hedef konum farklı bir ağaçtandı. - - Node is of the wrong type. Düğüm yanlış türde. - - Location must be null or from source. - Konum boş veya kaynağa ait olmalıdır. - - Duplicate source file '{0}' in project '{1}' '{1}' projesinde yinelenen kaynak dosyası '{0}' @@ -452,16 +407,6 @@ Desteklenmeyen operatör '{0}' için kod üretilemiyor - - Invalid number of parameters for binary operator. - İkili operatör için parametre sayısı geçersiz. - - - - Invalid number of parameters for unary operator. - Birli operatör için parametre sayısı geçersiz. - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Dosya uzantısı '{1}' bir dil ile ilişkili olmadığı için '{0}' projesi açılamıyor. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf index d7f065176dd1f..2b3834b392764 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf @@ -52,11 +52,6 @@ DateTimeKind 必须是 Utc - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - 目标类型必须是 {0}、{1}、{2} 或 {3},但给定类型是 {4}。 - - Document does not support syntax trees 文档不支持语法树 @@ -137,51 +132,11 @@ 在扩展中检测到循环 - - Destination type must be a {0}, but given one is {1}. - 目标类型必须是 {0},但给定类型是 {1}。 - - - - Destination type must be a {0} or a {1}, but given one is {2}. - 目标类型必须是 {0} 或 {1},但给定类型是 {2}。 - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - 目标类型必须是 {0}、{1} 或 {2},但给定类型是 {3}。 - - - - Could not find location to generation symbol into. - 找不到符号生成到的位置。 - - - - No location provided to add statements to. - 未提供语句要添加到的位置。 - - - - Destination location was not in source. - 目标位置不在源中。 - - - - Destination location was from a different tree. - 目标位置来自不同的树。 - - Node is of the wrong type. 节点类型不正确。 - - Location must be null or from source. - 位置必须为 null 或来自源。 - - Duplicate source file '{0}' in project '{1}' 项目“{1}”中源文件“{0}”重复 @@ -452,16 +407,6 @@ 无法为不受支持的运算符“{0}”生成代码 - - Invalid number of parameters for binary operator. - 参数数目对二元运算符无效。 - - - - Invalid number of parameters for unary operator. - 参数数目对一元运算符无效。 - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. 无法打开项目“{0}”, 因为文件扩展名“{1}”没有与某种语言关联。 diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf index 939d15173014c..fdf0efabef1d5 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf @@ -52,11 +52,6 @@ DateTimeKind 必須是 Utc - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - 目的地類型必須是 {0}、{1}、{2} 或 {3},但提供的類型是 {4}。 - - Document does not support syntax trees 文件不支援語法樹 @@ -137,51 +132,11 @@ 在擴充功能中偵測到循環 - - Destination type must be a {0}, but given one is {1}. - 目的地類型必須是 {0},但提供的是 {1}。 - - - - Destination type must be a {0} or a {1}, but given one is {2}. - 目的地類型必須是 {0} 或 {1},但提供的是 {2}。 - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - 目的地類型必須是 {0}、{1} 或 {2},但提供的是 {3}。 - - - - Could not find location to generation symbol into. - 找不到產生符號目的地位置。 - - - - No location provided to add statements to. - 未提供加入陳述式的位置。 - - - - Destination location was not in source. - 目的地位置不在來源中。 - - - - Destination location was from a different tree. - 目的地位置來自不同的樹狀目錄。 - - Node is of the wrong type. 節點類型不正確。 - - Location must be null or from source. - 位置必須是 null 或源自來源。 - - Duplicate source file '{0}' in project '{1}' 複製專案 '{1}' 中的原始程式檔 '{0}' @@ -452,16 +407,6 @@ 無法產生不受支援之運算子 '{0}' 的程式碼 - - Invalid number of parameters for binary operator. - 二元運算子的參數數目無效。 - - - - Invalid number of parameters for unary operator. - 一元運算子的參數數目無效。 - - Cannot open project '{0}' because the file extension '{1}' is not associated with a language. 無法開啟專案 '{0}',因為副檔名 '{1}' 未與語言相關聯。 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs index 34d3c61dd7f1a..923f603901323 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs @@ -3,6 +3,8 @@ // See the LICENSE file in the project root for more information. using System; +using System.Collections.Immutable; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis.LanguageServices; @@ -10,6 +12,27 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class IMethodSymbolExtensions { + /// + /// Returns the methodSymbol and any partial parts. + /// + public static ImmutableArray GetAllMethodSymbolsOfPartialParts(this IMethodSymbol method) + { + if (method.PartialDefinitionPart != null) + { + Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); + return ImmutableArray.Create(method, method.PartialDefinitionPart); + } + else if (method.PartialImplementationPart != null) + { + Debug.Assert(!Equals(method.PartialImplementationPart, method)); + return ImmutableArray.Create(method.PartialImplementationPart, method); + } + else + { + return ImmutableArray.Create(method); + } + } + /// /// Returns true for void returning methods with two parameters, where /// the first parameter is of type and the second diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs index d90f5d03d5f67..ccae323b36542 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs @@ -12,10 +12,27 @@ using Microsoft.CodeAnalysis.Shared.Utilities; using Roslyn.Utilities; +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else +using Microsoft.CodeAnalysis.Editing; +#endif + namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class ISymbolExtensions { + public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol) + { + return new DeclarationModifiers( + isStatic: symbol.IsStatic, + isAbstract: symbol.IsAbstract, + isUnsafe: symbol.RequiresUnsafeModifier(), + isVirtual: symbol.IsVirtual, + isOverride: symbol.IsOverride, + isSealed: symbol.IsSealed); + } + public static string ToNameDisplayString(this ISymbol symbol) => symbol.ToDisplayString(SymbolDisplayFormats.NameFormat); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs index 0a3dd965b3f54..b9695d23e8e1a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs @@ -62,5 +62,21 @@ public static bool TryRemoveFirst(this IList list, Func(this IList list, Func predicate) + { + Contract.ThrowIfNull(list); + Contract.ThrowIfNull(predicate); + + for (var i = 0; i < list.Count; i++) + { + if (predicate(list[i])) + { + return i; + } + } + + return -1; + } } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs index 6f39379e5a29e..89325f2535625 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs @@ -5,11 +5,30 @@ using System; using System.Threading; using Microsoft.CodeAnalysis.Text; +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class SourceTextExtensions { + /// + /// Returns the leading whitespace of the line located at the specified position in the given snapshot. + /// + public static string GetLeadingWhitespaceOfLineAtPosition(this SourceText text, int position) + { + Contract.ThrowIfNull(text); + + var line = text.Lines.GetLineFromPosition(position); + var linePosition = line.GetFirstNonWhitespacePosition(); + if (!linePosition.HasValue) + { + return line.ToString(); + } + + var lineText = line.ToString(); + return lineText.Substring(0, linePosition.Value - line.Start); + } + public static bool OverlapsHiddenPosition( this SourceText text, TextSpan span, Func isPositionHidden, CancellationToken cancellationToken) { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems index f4ccbf505feb8..c50917f98c57d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems @@ -9,6 +9,31 @@ Microsoft.CodeAnalysis.CSharp.Shared + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/ArgumentGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ArgumentGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/ArgumentGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ArgumentGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/AttributeGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/AttributeGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/AttributeGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/AttributeGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationHelpers.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationHelpers.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationHelpers.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationHelpers.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationOptions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationOptions.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationOptions.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationOptions.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationPreferences.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationPreferences.cs similarity index 95% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationPreferences.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationPreferences.cs index b82d4859e943d..a3bf3a4467dd6 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationPreferences.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationPreferences.cs @@ -8,9 +8,14 @@ using Microsoft.CodeAnalysis.CodeGeneration; using Microsoft.CodeAnalysis.CodeStyle; using Microsoft.CodeAnalysis.CSharp.CodeStyle; -using Microsoft.CodeAnalysis.Options; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + namespace Microsoft.CodeAnalysis.CSharp.CodeGeneration { internal sealed class CSharpCodeGenerationPreferences : CodeGenerationPreferences diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationService.cs similarity index 99% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationService.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationService.cs index 71ca665e7f620..2e88507378078 100644 --- a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationService.cs @@ -15,11 +15,16 @@ using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.LanguageServices; -using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + namespace Microsoft.CodeAnalysis.CSharp.CodeGeneration { internal partial class CSharpCodeGenerationService : AbstractCodeGenerationService diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationServiceFactory.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationServiceFactory.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationServiceFactory.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationServiceFactory.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpDeclarationComparer.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpDeclarationComparer.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpDeclarationComparer.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpDeclarationComparer.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpFlagsEnumGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpFlagsEnumGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpFlagsEnumGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpFlagsEnumGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpSyntaxGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpSyntaxGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/ConstructorGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConstructorGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/ConstructorGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConstructorGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/ConversionGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConversionGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/ConversionGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConversionGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/DestructorGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/DestructorGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/DestructorGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/DestructorGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/EnumMemberGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EnumMemberGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/EnumMemberGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EnumMemberGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/EventGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EventGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/EventGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EventGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/ExpressionGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ExpressionGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/ExpressionGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ExpressionGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/FieldGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/FieldGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/FieldGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/FieldGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/MethodGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/MethodGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/MethodGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/MethodGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamedTypeGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamedTypeGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/NamespaceGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamespaceGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/NamespaceGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamespaceGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/OperatorGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/OperatorGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/OperatorGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/OperatorGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/ParameterGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ParameterGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/ParameterGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ParameterGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/PropertyGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/PropertyGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/PropertyGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/PropertyGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/StatementGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/StatementGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/StatementGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/StatementGenerator.cs diff --git a/src/Workspaces/CSharp/Portable/CodeGeneration/TypeParameterGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/TypeParameterGenerator.cs similarity index 100% rename from src/Workspaces/CSharp/Portable/CodeGeneration/TypeParameterGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/TypeParameterGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs index 1b726becb9d2b..449d8c4fbae50 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs @@ -15,6 +15,13 @@ using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + + namespace Microsoft.CodeAnalysis.CSharp.AddImport { [ExportLanguageService(typeof(IAddImportsService), LanguageNames.CSharp), Shared] @@ -27,12 +34,10 @@ public CSharpAddImportsService() { } -#if !CODE_STYLE - public override bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet) + public override bool PlaceImportsInsideNamespaces(OptionSet optionSet) { return optionSet.GetOption(CSharpCodeStyleOptions.PreferredUsingDirectivePlacement).Value == AddImportPlacement.InsideNamespace; } -#endif // C# doesn't have global imports. protected override ImmutableArray GetGlobalImports(Compilation compilation, SyntaxGenerator generator) diff --git a/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService.cs similarity index 95% rename from src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService.cs index ef33ce30a9c2d..180cac4cc6543 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService.cs @@ -12,12 +12,18 @@ using Microsoft.CodeAnalysis.AddImport; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.LanguageServices; -using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Simplification; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + + namespace Microsoft.CodeAnalysis.CodeGeneration { internal abstract partial class AbstractCodeGenerationService : ICodeGenerationService @@ -154,7 +160,7 @@ protected static void CheckDeclarationNode(SyntaxNode destinat if (destination is not TDeclarationNode) { throw new ArgumentException( - string.Format(WorkspacesResources.Destination_type_must_be_a_0_but_given_one_is_1, typeof(TDeclarationNode).Name, destination.GetType().Name), + string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_but_given_one_is_1, typeof(TDeclarationNode).Name, destination.GetType().Name), nameof(destination)); } } @@ -172,7 +178,7 @@ protected static void CheckDeclarationNode not TDeclarationNode2) { throw new ArgumentException( - string.Format(WorkspacesResources.Destination_type_must_be_a_0_or_a_1_but_given_one_is_2, + string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_or_a_1_but_given_one_is_2, typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, destination.GetType().Name), nameof(destination)); } @@ -193,7 +199,7 @@ not TDeclarationNode2 and not TDeclarationNode3) { throw new ArgumentException( - string.Format(WorkspacesResources.Destination_type_must_be_a_0_1_or_2_but_given_one_is_3, + string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_1_or_2_but_given_one_is_3, typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, destination.GetType().Name), nameof(destination)); } @@ -211,7 +217,7 @@ not TDeclarationNode3 and not TDeclarationNode4) { throw new ArgumentException( - string.Format(WorkspacesResources.Destination_type_must_be_a_0_1_2_or_3_but_given_one_is_4, + string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_1_2_or_3_but_given_one_is_4, typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name, destination.GetType().Name), nameof(destination)); } @@ -229,7 +235,7 @@ private async Task GetEditAsync( if (destinationDeclaration == null) { - throw new ArgumentException(WorkspacesResources.Could_not_find_location_to_generation_symbol_into); + throw new ArgumentException(WorkspaceExtensionsResources.Could_not_find_location_to_generation_symbol_into); } var destinationTree = destinationDeclaration.SyntaxTree; @@ -245,7 +251,13 @@ private async Task GetEditAsync( if (context.AddImports) { var addImportsOptions = await AddImportPlacementOptions.FromDocumentAsync(newDocument, cancellationToken).ConfigureAwait(false); - newDocument = await ImportAdder.AddImportsFromSymbolAnnotationAsync(newDocument, addImportsOptions, cancellationToken).ConfigureAwait(false); + var importAdder = newDocument.GetRequiredLanguageService(); + newDocument = await importAdder.AddImportsAsync( + newDocument, + SpecializedCollections.SingletonEnumerable(currentRoot.FullSpan), + ImportAdderService.Strategy.AddImportsFromSymbolAnnotations, + addImportsOptions, + cancellationToken).ConfigureAwait(false); } return newDocument; @@ -470,17 +482,17 @@ protected static void CheckLocation(SyntaxNode destinationMember, [NotNull] Loca { if (location == null) { - throw new ArgumentException(WorkspacesResources.No_location_provided_to_add_statements_to); + throw new ArgumentException(WorkspaceExtensionsResources.No_location_provided_to_add_statements_to); } if (!location.IsInSource) { - throw new ArgumentException(WorkspacesResources.Destination_location_was_not_in_source); + throw new ArgumentException(WorkspaceExtensionsResources.Destination_location_was_not_in_source); } if (location.SourceTree != destinationMember.SyntaxTree) { - throw new ArgumentException(WorkspacesResources.Destination_location_was_from_a_different_tree); + throw new ArgumentException(WorkspaceExtensionsResources.Destination_location_was_from_a_different_tree); } } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs similarity index 99% rename from src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs index b3c34ae5a3963..8325c7ef813b1 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs @@ -80,7 +80,7 @@ private bool CanAddTo(SyntaxNode? destination, Solution solution, CancellationTo // If we are avoiding generating into files marked as generated (but are still regular files) // then check accordingly. This is distinct from the prior check in that we as a fallback // will generate into these files is we have no alternative. - if (checkGeneratedCode && document.IsGeneratedCode(cancellationToken)) + if (checkGeneratedCode && document.IsGeneratedCode(syntaxTree, cancellationToken)) { return false; } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/AbstractFlagsEnumGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractFlagsEnumGenerator.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/AbstractFlagsEnumGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractFlagsEnumGenerator.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationContext.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationContext.cs similarity index 99% rename from src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationContext.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationContext.cs index f1be39d46f4c0..3162ef6cff9da 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationContext.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationContext.cs @@ -167,7 +167,7 @@ private static void CheckLocation(Location? location, string name) { if (location != null && !location.IsInSource) { - throw new ArgumentException(WorkspacesResources.Location_must_be_null_or_from_source, name); + throw new ArgumentException(WorkspaceExtensionsResources.Location_must_be_null_or_from_source, name); } } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationDestination.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationDestination.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationDestination.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationDestination.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationHelpers.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs similarity index 99% rename from src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationHelpers.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs index 5194dbd5f5e1e..3877b049c3e78 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationHelpers.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs @@ -119,7 +119,7 @@ public static bool TryGetDocumentationComment( ISymbol symbol, string commentToken, [NotNullWhen(true)] out string? comment, CancellationToken cancellationToken = default) { var xml = symbol.GetDocumentationCommentXml(cancellationToken: cancellationToken); - if (string.IsNullOrEmpty(xml)) + if (RoslynString.IsNullOrEmpty(xml)) { comment = null; return false; @@ -167,7 +167,7 @@ public static IEnumerable GetMembers(INamedTypeSymbol namedType) } return f1.HasConstantValue - ? Comparer.Default.Compare(f1.ConstantValue, f2.ConstantValue) + ? Comparer.Default.Compare(f1.ConstantValue, f2.ConstantValue!) : f1.Name.CompareTo(f2.Name); }).ToList(); } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOperatorKind.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOperatorKind.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOperatorKind.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOperatorKind.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOptions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOptions.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOptions.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOptions.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs index 3b36e4cff23a0..e85c1d81aafb2 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs @@ -7,6 +7,7 @@ using Roslyn.Utilities; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Editing; +using Microsoft.CodeAnalysis.Diagnostics; #if CODE_STYLE using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; @@ -34,18 +35,21 @@ public CodeGenerationPreferences(OptionSet options) public bool PlaceSystemNamespaceFirst => Options.GetOption(GenerationOptions.PlaceSystemNamespaceFirst, Language); -#if !CODE_STYLE public abstract CodeGenerationOptions GetOptions(CodeGenerationContext context); public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) { var parseOptions = document.Project.ParseOptions; Contract.ThrowIfNull(parseOptions); - +#if CODE_STYLE + var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); + var documentOptions = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(tree, cancellationToken); +#else var documentOptions = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); +#endif + var codeGenerationService = document.GetRequiredLanguageService(); return codeGenerationService.GetPreferences(parseOptions, documentOptions); } -#endif } } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationSymbolFactory.cs similarity index 99% rename from src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationSymbolFactory.cs index 2ef60b41f806d..cfa882aede743 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationSymbolFactory.cs @@ -6,9 +6,14 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Shared.Extensions; +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else +using Microsoft.CodeAnalysis.Editing; +#endif + namespace Microsoft.CodeAnalysis.CodeGeneration { /// @@ -202,8 +207,8 @@ public static IMethodSymbol CreateOperatorSymbol( if (parameters.Length != expectedParameterCount) { var message = expectedParameterCount == 1 ? - WorkspacesResources.Invalid_number_of_parameters_for_unary_operator : - WorkspacesResources.Invalid_number_of_parameters_for_binary_operator; + WorkspaceExtensionsResources.Invalid_number_of_parameters_for_unary_operator : + WorkspaceExtensionsResources.Invalid_number_of_parameters_for_binary_operator; throw new ArgumentException(message, nameof(parameters)); } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerator.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/CodeGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerator.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/ICodeGenerationService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ICodeGenerationService.cs similarity index 98% rename from src/Workspaces/Core/Portable/CodeGeneration/ICodeGenerationService.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ICodeGenerationService.cs index 84b85e9e18d6d..b83d17069bbdf 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/ICodeGenerationService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ICodeGenerationService.cs @@ -6,7 +6,13 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Host; -using Microsoft.CodeAnalysis.Options; + +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/INamedTypeSymbolExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/INamedTypeSymbolExtensions.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/INamedTypeSymbolExtensions.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/INamedTypeSymbolExtensions.cs diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/ITypeGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ITypeGenerator.cs similarity index 100% rename from src/Workspaces/Core/Portable/Shared/Extensions/ITypeGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ITypeGenerator.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/LiteralSpecialValues.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/LiteralSpecialValues.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/LiteralSpecialValues.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/LiteralSpecialValues.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/NullableSyntaxAnnotation.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/NullableSyntaxAnnotation.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/NullableSyntaxAnnotation.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/NullableSyntaxAnnotation.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs similarity index 98% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs index c040bccc0cdd0..d22dda6e7dceb 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs @@ -6,7 +6,12 @@ using System.Collections.Immutable; using System.Reflection.Metadata; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs similarity index 98% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs index afb4c096ccf9d..4599685e658f9 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs @@ -7,7 +7,12 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAttributeData.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAttributeData.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAttributeData.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAttributeData.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs similarity index 96% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs index c1aa5ebb8ea00..be6376ceae81d 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs @@ -5,7 +5,12 @@ #nullable disable using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs similarity index 95% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs index e8d7d0eecc34e..b41e77f7259c1 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs @@ -5,7 +5,12 @@ #nullable disable using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventInfo.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventInfo.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventInfo.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventInfo.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs similarity index 97% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs index 7b7949f8b12d3..efed6d2d9edc4 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs @@ -3,7 +3,12 @@ // See the LICENSE file in the project root for more information. using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs similarity index 97% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs index ceb695c493def..e5b1f1d092ba8 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs @@ -5,7 +5,12 @@ #nullable disable using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs similarity index 98% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs index f17a9dabd284c..c66f84eb97c5e 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs @@ -7,7 +7,12 @@ using System; using System.Collections.Immutable; using System.Diagnostics; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs similarity index 98% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs index 9176276d0b62e..544470cbb8caa 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs @@ -8,9 +8,14 @@ using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis; -using Microsoft.CodeAnalysis.Editing; using Roslyn.Utilities; +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else +using Microsoft.CodeAnalysis.Editing; +#endif + namespace Microsoft.CodeAnalysis.CodeGeneration { internal class CodeGenerationNamedTypeSymbol : CodeGenerationAbstractNamedTypeSymbol diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs similarity index 95% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs index f8d25434497b1..4cf190debb603 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs @@ -5,7 +5,12 @@ #nullable disable using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs similarity index 98% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs index 2e99829026b52..c5968021388e8 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs @@ -5,9 +5,14 @@ #nullable disable using System.Collections.Immutable; -using Microsoft.CodeAnalysis.Editing; using Roslyn.Utilities; +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else +using Microsoft.CodeAnalysis.Editing; +#endif + namespace Microsoft.CodeAnalysis.CodeGeneration { internal class CodeGenerationOperatorSymbol : CodeGenerationMethodSymbol diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs similarity index 97% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs index 5c24c75230aaa..87e5dabf4dd0b 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs @@ -5,7 +5,12 @@ #nullable disable using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs similarity index 97% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs index 7909d1f0a6ca4..bef1da886c368 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs @@ -5,7 +5,12 @@ #nullable disable using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationSymbol.cs similarity index 88% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationSymbol.cs index d120665f77ef4..bb8a7b16c9245 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationSymbol.cs @@ -9,9 +9,14 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Shared.Extensions; +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else +using Microsoft.CodeAnalysis.Editing; +#endif + namespace Microsoft.CodeAnalysis.CodeGeneration { internal abstract class CodeGenerationSymbol : ISymbol @@ -64,12 +69,30 @@ private static CodeGenerationSymbol AddAnnotationsTo( { annotationsTable.TryGetValue(originalDefinition, out var originalAnnotations); - annotations = SyntaxAnnotationExtensions.CombineAnnotations(originalAnnotations, annotations); + annotations = CombineAnnotations(originalAnnotations, annotations); annotationsTable.Add(newDefinition, annotations); return newDefinition; } + private static SyntaxAnnotation[] CombineAnnotations( + SyntaxAnnotation[] originalAnnotations, + SyntaxAnnotation[] newAnnotations) + { + if (!originalAnnotations.IsNullOrEmpty()) + { + // Make a new array (that includes the new annotations) and copy the original + // annotations into it. + var finalAnnotations = newAnnotations; + Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); + Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length); + + return finalAnnotations; + } + + return newAnnotations; + } + public abstract SymbolKind Kind { get; } public string Language => "Code Generation Agnostic Language"; diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs diff --git a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs similarity index 98% rename from src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs index efaa88336e672..93a364de72e54 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs @@ -5,7 +5,12 @@ #nullable disable using System.Collections.Immutable; + +#if CODE_STYLE +using Microsoft.CodeAnalysis.Internal.Editing; +#else using Microsoft.CodeAnalysis.Editing; +#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/Core/Portable/CodeGeneration/SyntaxAnnotationExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/SyntaxAnnotationExtensions.cs similarity index 52% rename from src/Workspaces/Core/Portable/CodeGeneration/SyntaxAnnotationExtensions.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/SyntaxAnnotationExtensions.cs index 52f0d7a276b5c..018cc2f3bebc3 100644 --- a/src/Workspaces/Core/Portable/CodeGeneration/SyntaxAnnotationExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/SyntaxAnnotationExtensions.cs @@ -19,23 +19,5 @@ public static TSymbol AddAnnotationToSymbol( var codeGenSymbol = (CodeGenerationSymbol)(object)symbol; return (TSymbol)(object)codeGenSymbol.WithAdditionalAnnotations(annotation); } - - internal static SyntaxAnnotation[] CombineAnnotations( - SyntaxAnnotation[] originalAnnotations, - SyntaxAnnotation[] newAnnotations) - { - if (!originalAnnotations.IsNullOrEmpty()) - { - // Make a new array (that includes the new annotations) and copy the original - // annotations into it. - var finalAnnotations = newAnnotations; - Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); - Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length); - - return finalAnnotations; - } - - return newAnnotations; - } } } diff --git a/src/Workspaces/Core/Portable/CodeGeneration/TypeGenerator.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/TypeGenerator.cs similarity index 100% rename from src/Workspaces/Core/Portable/CodeGeneration/TypeGenerator.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/TypeGenerator.cs diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/ArrayExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/ArrayExtensions.cs similarity index 100% rename from src/Workspaces/Core/Portable/Shared/Extensions/ArrayExtensions.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/ArrayExtensions.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs index baa5040bc0af0..ba930e585ddbf 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs @@ -187,6 +187,12 @@ public static bool IsGeneratedCode(this Document document, CancellationToken can } #endif + public static bool IsGeneratedCode(this Document document, SyntaxTree tree, CancellationToken cancellationToken) + { + var generatedCodeRecognitionService = document.GetLanguageService(); + return generatedCodeRecognitionService?.IsGeneratedCode(tree, document, cancellationToken) == true; + } + public static async Task IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) { var generatedCodeRecognitionService = document.GetLanguageService(); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs index 68eac08935bf7..04763463f1f96 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs @@ -10,6 +10,12 @@ using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Shared.Extensions; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + namespace Microsoft.CodeAnalysis.AddImport { internal abstract class AbstractAddImportsService @@ -29,9 +35,7 @@ protected AbstractAddImportsService() protected abstract SyntaxList GetExterns(SyntaxNode node); protected abstract bool IsStaticUsing(TUsingOrAliasSyntax usingOrAlias); -#if !CODE_STYLE - public abstract bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet); -#endif + public abstract bool PlaceImportsInsideNamespaces(OptionSet optionSet); private bool IsSimpleUsing(TUsingOrAliasSyntax usingOrAlias) => !IsAlias(usingOrAlias) && !IsStaticUsing(usingOrAlias); private bool IsAlias(TUsingOrAliasSyntax usingOrAlias) => GetAlias(usingOrAlias) != null; diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs index 489d167099e4b..ceee0a3cd7a2e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs @@ -6,11 +6,18 @@ using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using Microsoft.CodeAnalysis.Options; +#endif + namespace Microsoft.CodeAnalysis.AddImport { [DataContract] @@ -23,7 +30,7 @@ internal record struct AddImportPlacementOptions( public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) => FromDocument(document, await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false)); - public static AddImportPlacementOptions FromDocument(Document document, Options.OptionSet documentOptions) + public static AddImportPlacementOptions FromDocument(Document document, OptionSet documentOptions) { var service = document.GetRequiredLanguageService(); @@ -41,14 +48,22 @@ private static bool CanAddImportsInHiddenRegions(Document document) var spanMapper = document.Services.GetService(); return spanMapper != null && spanMapper.SupportsMappingImportDirectives; } +#else + public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) + { + var service = document.GetRequiredLanguageService(); + var options = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false), cancellationToken); + return new( + PlaceSystemNamespaceFirst: options.GetOption(GenerationOptions.PlaceSystemNamespaceFirst), + PlaceImportsInsideNamespaces: service.PlaceImportsInsideNamespaces(options), + AllowInHiddenRegions: false); + } #endif } internal interface IAddImportsService : ILanguageService { -#if !CODE_STYLE - bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet); -#endif + bool PlaceImportsInsideNamespaces(OptionSet optionSet); /// /// Returns true if the tree already has an existing import syntactically equivalent to diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs index 3547f536f7542..12819c4d7f6c8 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs @@ -28,7 +28,7 @@ public async Task IsGeneratedCodeAsync(Document document, CancellationToke return IsGeneratedCode(syntaxTree, document, cancellationToken); } - private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken) + public bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken) { var syntaxFacts = document.GetLanguageService(); return syntaxTree.IsGeneratedCode(document.Project.AnalyzerOptions, syntaxFacts, cancellationToken); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs index f4e7b1dea31c4..55f8b414fcc31 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs @@ -17,5 +17,7 @@ internal interface IGeneratedCodeRecognitionService : ILanguageService #endif Task IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken); + + bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken); } } diff --git a/src/Workspaces/Core/Portable/Editing/ImportAdderService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/ImportAdder/ImportAdderService.cs similarity index 100% rename from src/Workspaces/Core/Portable/Editing/ImportAdderService.cs rename to src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/ImportAdder/ImportAdderService.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems index 6d798ec06c87a..90960257abe40 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems @@ -10,8 +10,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -39,6 +86,7 @@ + diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx index f5b438da33afe..2bf8009eed9e8 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx @@ -144,4 +144,37 @@ Warning: Declaration changes scope and may change meaning. + + Location must be null or from source. + + + Could not find location to generation symbol into. + + + Destination location was from a different tree. + + + Destination location was not in source. + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + Destination type must be a {0}, but given one is {1}. + + + Destination type must be a {0} or a {1}, but given one is {2}. + + + No location provided to add statements to. + + + Invalid number of parameters for binary operator. + + + Invalid number of parameters for unary operator. + \ No newline at end of file diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf index b260a21696b04..15ce5cde54f35 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf @@ -7,6 +7,41 @@ K provedení úlohy se vyžaduje kompilace, ale projekt {0} ji nepodporuje. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Opravit vše ({0}) @@ -22,6 +57,26 @@ Opravit vše ({0}) v řešení + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Ke splnění úkolu se vyžaduje projekt s ID {0}, který ale není z řešení dostupný. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf index e1b4b7ed01fc5..f3318f32fe58b 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf @@ -7,6 +7,41 @@ Die Kompilierung ist zum Ausführen der Aufgabe erforderlich, wird aber vom Projekt "{0}" nicht unterstützt. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Alle '{0}' reparieren @@ -22,6 +57,26 @@ Alle '{0}' in Lösung reparieren + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Ein Projekt mit der ID "{0}" ist zum Ausführen der Aufgabe erforderlich, steht aber in der Projektmappe nicht zur Verfügung. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf index 1b78e6d680b8a..10e0c0bdeed4e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf @@ -7,6 +7,41 @@ La compilación es necesaria para realizar la tarea, pero el proyecto {0} no la admite. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Corregir todo '{0}' @@ -22,6 +57,26 @@ Corregir todo '{0}' en solución + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Se necesita el identificador de proyecto "{0}" para realizar la tarea, pero no está disponibles en la solución diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf index c00a9f0c92b08..00f6c594cbafb 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf @@ -7,6 +7,41 @@ Une compilation est nécessaire pour accomplir la tâche, mais elle n'est pas prise en charge par le projet {0}. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Corriger tous les '{0}' @@ -22,6 +57,26 @@ Corriger tous les '{0}' dans la solution + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Le projet de l'ID {0} est nécessaire pour accomplir la tâche mais n'est pas disponible dans la solution diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf index 584ccef5f4fb7..5324bd365f72f 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf @@ -7,6 +7,41 @@ Per eseguire l'attività, è necessaria la compilazione, che però non è supportata dal progetto {0}. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Correggi tutti '{0}' @@ -22,6 +57,26 @@ Correggi tutti '{0}' nella soluzione + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Per eseguire l'attività, è necessario il progetto con ID '{0}', che però non è disponibile dalla soluzione diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf index 878a0817f7cb4..770f670759bfd 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf @@ -7,6 +7,41 @@ コンパイルはタスクの実行に必要ですが、プロジェクト {0} ではサポートされていません。 + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' すべての '{0}' を修正します @@ -22,6 +57,26 @@ ソリューションに含まれているすべての '{0}' を修正します + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution タスクの完了には ID {0} のプロジェクトが必要ですが、このソリューションからは利用できません diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf index b7893a187a979..0b9a670077886 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf @@ -7,6 +7,41 @@ 작업을 수행하는 데 컴파일이 필요하지만 프로젝트 {0}에서 지원하지 않습니다. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' 모든 '{0}' 수정 @@ -22,6 +57,26 @@ 솔루션의 모든 '{0}' 수정 + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution 작업을 수행하는 데 ID가 {0}인 프로젝트가 필요하지만, 솔루션에서 해당 프로젝트를 사용할 수 없습니다. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf index 6ce41179340ce..0169ce14061b0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf @@ -7,6 +7,41 @@ Ukończenie zadania wymaga kompilacji, ale nie jest ona obsługiwana przez projekt {0}. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Napraw wszystkie wystąpienia elementu „{0}” @@ -22,6 +57,26 @@ Napraw wszystkie wystąpienia elementu „{0}” w rozwiązaniu + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Do wykonania zadania wymagany jest projekt o identyfikatorze {0}, ale nie jest on udostępniany przez rozwiązanie diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf index d9f762bf4227e..d5184729cebc9 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf @@ -7,6 +7,41 @@ A compilação é necessária para realizar a tarefa, mas não é compatível com o projeto {0}. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Corrigir todos os '{0}' @@ -22,6 +57,26 @@ Corrigir todos os '{0}' na Solução + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution O projeto com a ID {0} é necessário para realizar a tarefa, mas não está disponível na solução diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf index 742117c1c9930..36f75411bc17a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf @@ -7,6 +7,41 @@ Для выполнения задачи требуется компиляция, но она не поддерживается в проекте {0}. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Исправить все "{0}" @@ -22,6 +57,26 @@ Исправить все "{0}" в решении + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Проект с ИД "{0}" необходим для выполнения задачи, но он недоступен из решения. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf index befe4cda1ace2..92f78344b59f8 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf @@ -7,6 +7,41 @@ Görevi gerçekleştirmek için derleme gerekiyor ancak bu, {0} projesi tarafından desteklenmiyor. + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' Geçtiği her yerde '{0}' ifadesini düzelt @@ -22,6 +57,26 @@ Çözüm'de geçtiği her yerde '{0}' ifadesini düzelt + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution Görevi gerçekleştirmek için '{0}' kimlikli proje gerekli, ancak bu proje çözümde yok diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf index 6196afb3309a9..2ccebe3aa24ec 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf @@ -7,6 +7,41 @@ 必须进行编译才能完成该任务,但项目 {0} 不支持此操作。 + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' 修复所有“{0}” @@ -22,6 +57,26 @@ 修复解决方案中的所有“{0}” + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution 需要 ID 为 {0} 的项目才能完成任务,但无法从解决方案中使用该项目 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf index 726bc7c6fa2ab..c1e9af3667f5a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf @@ -7,6 +7,41 @@ 必須編譯才能完成工作,但專案 {0} 並不支援。 + + Could not find location to generation symbol into. + Could not find location to generation symbol into. + + + + Destination location was from a different tree. + Destination location was from a different tree. + + + + Destination location was not in source. + Destination location was not in source. + + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + + Destination type must be a {0}, but given one is {1}. + Destination type must be a {0}, but given one is {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Destination type must be a {0} or a {1}, but given one is {2}. + + Fix all '{0}' 修正所有 '{0}' @@ -22,6 +57,26 @@ 修正方案中的所有 '{0}' + + Invalid number of parameters for binary operator. + Invalid number of parameters for binary operator. + + + + Invalid number of parameters for unary operator. + Invalid number of parameters for unary operator. + + + + Location must be null or from source. + Location must be null or from source. + + + + No location provided to add statements to. + No location provided to add statements to. + + Project of ID {0} is required to accomplish the task but is not available from the solution 完成工作需要識別碼為 {0} 的專案,但是無法從解決方案取得 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb index 035f8718aa952..88842d65e6cf6 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb @@ -12,6 +12,12 @@ Imports Microsoft.CodeAnalysis.PooledObjects Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.VisualBasic.Utilities +#If CODE_STYLE Then +Imports OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions +#Else +Imports Microsoft.CodeAnalysis.Options +#End If + Namespace Microsoft.CodeAnalysis.VisualBasic.AddImports Friend Class VisualBasicAddImportsService @@ -57,12 +63,11 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddImports FirstOrDefault()?.Alias End Function -#If Not CODE_STYLE Then - Public Overrides Function PlaceImportsInsideNamespaces(optionSet As Options.OptionSet) As Boolean + Public Overrides Function PlaceImportsInsideNamespaces(optionSet As OptionSet) As Boolean ' Visual Basic doesn't support imports inside namespaces Return False End Function -#End If + Protected Overrides Function IsStaticUsing(usingOrAlias As ImportsStatementSyntax) As Boolean ' Visual Basic doesn't support static imports Return False From 82f75a5a487af48f4f784befcf4fac0ceb144920 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Sat, 2 Apr 2022 14:24:17 +0200 Subject: [PATCH 2/6] Revert bad changes --- .../CodeGeneration/ArgumentGenerator.cs | 0 .../CodeGeneration/AttributeGenerator.cs | 0 .../CSharpCodeGenerationHelpers.cs | 0 .../CSharpCodeGenerationOptions.cs | 0 .../CSharpCodeGenerationPreferences.cs | 7 +-- .../CSharpCodeGenerationService.cs | 7 +-- .../CSharpCodeGenerationServiceFactory.cs | 0 .../CSharpDeclarationComparer.cs | 0 .../CSharpFlagsEnumGenerator.cs | 0 .../CodeGeneration/CSharpSyntaxGenerator.cs | 0 .../CodeGeneration/ConstructorGenerator.cs | 0 .../CodeGeneration/ConversionGenerator.cs | 0 .../CodeGeneration/DestructorGenerator.cs | 0 .../CodeGeneration/EnumMemberGenerator.cs | 0 .../CodeGeneration/EventGenerator.cs | 0 .../CodeGeneration/ExpressionGenerator.cs | 0 .../CodeGeneration/FieldGenerator.cs | 0 .../CodeGeneration/MethodGenerator.cs | 0 .../CodeGeneration/NamedTypeGenerator.cs | 0 .../CodeGeneration/NamespaceGenerator.cs | 0 .../CodeGeneration/OperatorGenerator.cs | 0 .../CodeGeneration/ParameterGenerator.cs | 0 .../CodeGeneration/PropertyGenerator.cs | 0 .../CodeGeneration/StatementGenerator.cs | 0 .../CodeGeneration/TypeParameterGenerator.cs | 0 .../AbstractCodeGenerationService.cs | 32 ++++------- ...ctCodeGenerationService_FindDeclaration.cs | 2 +- .../AbstractFlagsEnumGenerator.cs | 0 .../CodeGeneration/CodeGenerationContext.cs | 2 +- .../CodeGenerationDestination.cs | 0 .../CodeGeneration/CodeGenerationHelpers.cs | 4 +- .../CodeGenerationOperatorKind.cs | 0 .../CodeGeneration/CodeGenerationOptions.cs | 0 .../CodeGenerationSymbolFactory.cs | 11 +--- .../Portable}/CodeGeneration/CodeGenerator.cs | 0 .../CodeGeneration/ICodeGenerationService.cs | 8 +-- .../INamedTypeSymbolExtensions.cs | 0 .../CodeGeneration/LiteralSpecialValues.cs | 0 .../NullableSyntaxAnnotation.cs | 0 .../CodeGenerationAbstractMethodSymbol.cs | 5 -- .../CodeGenerationAbstractNamedTypeSymbol.cs | 5 -- .../Symbols/CodeGenerationArrayTypeSymbol.cs | 0 .../Symbols/CodeGenerationAttributeData.cs | 0 .../CodeGenerationConstructedMethodSymbol.cs | 0 ...odeGenerationConstructedNamedTypeSymbol.cs | 0 .../Symbols/CodeGenerationConstructorInfo.cs | 0 .../CodeGenerationConstructorSymbol.cs | 5 -- .../Symbols/CodeGenerationConversionSymbol.cs | 5 -- .../Symbols/CodeGenerationDestructorInfo.cs | 0 .../Symbols/CodeGenerationDestructorSymbol.cs | 0 .../Symbols/CodeGenerationEventInfo.cs | 0 .../Symbols/CodeGenerationEventSymbol.cs | 5 -- .../Symbols/CodeGenerationFieldInfo.cs | 0 .../Symbols/CodeGenerationFieldSymbol.cs | 5 -- .../Symbols/CodeGenerationMethodInfo.cs | 0 .../Symbols/CodeGenerationMethodSymbol.cs | 5 -- .../Symbols/CodeGenerationNamedTypeSymbol.cs | 7 +-- .../Symbols/CodeGenerationNamespaceInfo.cs | 0 .../CodeGenerationNamespaceOrTypeSymbol.cs | 5 -- .../Symbols/CodeGenerationNamespaceSymbol.cs | 0 .../Symbols/CodeGenerationOperatorSymbol.cs | 7 +-- .../Symbols/CodeGenerationParameterSymbol.cs | 5 -- .../CodeGenerationPointerTypeSymbol.cs | 0 .../Symbols/CodeGenerationPropertyInfo.cs | 0 .../Symbols/CodeGenerationPropertySymbol.cs | 5 -- .../Symbols/CodeGenerationSymbol.cs | 27 +-------- .../CodeGenerationTypeParameterSymbol.cs | 0 .../Symbols/CodeGenerationTypeSymbol.cs | 5 -- .../SyntaxAnnotationExtensions.cs | 18 ++++++ .../Portable}/CodeGeneration/TypeGenerator.cs | 0 .../Portable/Editing}/ImportAdderService.cs | 0 .../Shared}/Extensions/ArrayExtensions.cs | 0 .../Shared/Extensions/IListExtensions.cs | 29 ++++++++++ .../Extensions/IMethodSymbolExtensions.cs | 21 +++++++ .../Shared/Extensions/ISymbolExtensions.cs | 11 ++++ .../Shared/Extensions}/ITypeGenerator.cs | 0 .../Shared/Extensions/SourceTextExtensions.cs | 18 ++++++ .../Core/Portable/WorkspacesResources.resx | 33 +++++++++++ .../Portable/xlf/WorkspacesResources.cs.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.de.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.es.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.fr.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.it.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.ja.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.ko.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.pl.xlf | 55 +++++++++++++++++++ .../xlf/WorkspacesResources.pt-BR.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.ru.xlf | 55 +++++++++++++++++++ .../Portable/xlf/WorkspacesResources.tr.xlf | 55 +++++++++++++++++++ .../xlf/WorkspacesResources.zh-Hans.xlf | 55 +++++++++++++++++++ .../xlf/WorkspacesResources.zh-Hant.xlf | 55 +++++++++++++++++++ .../Extensions/IMethodSymbolExtensions.cs | 23 -------- .../Core/Extensions/ISymbolExtensions.cs | 17 ------ .../Core/Extensions/ListExtensions.cs | 16 ------ ...ourceTextExtensions_SharedWithCodeStyle.cs | 19 ------- .../CSharpWorkspaceExtensions.projitems | 25 --------- .../CSharpAddImportsService.cs | 11 +--- .../CodeGenerationPreferences.cs | 10 +--- .../Core/Extensions/DocumentExtensions.cs | 6 -- .../AddImports/AbstractAddImportsService.cs | 10 +--- .../AddImports/IAddImportsService.cs | 23 ++------ ...AbstractGeneratedCodeRecognitionService.cs | 2 +- .../IGeneratedCodeRecognitionService.cs | 2 - .../Core/WorkspaceExtensions.projitems | 48 ---------------- .../Core/WorkspaceExtensionsResources.resx | 33 ----------- .../xlf/WorkspaceExtensionsResources.cs.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.de.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.es.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.fr.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.it.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.ja.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.ko.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.pl.xlf | 55 ------------------- .../WorkspaceExtensionsResources.pt-BR.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.ru.xlf | 55 ------------------- .../xlf/WorkspaceExtensionsResources.tr.xlf | 55 ------------------- .../WorkspaceExtensionsResources.zh-Hans.xlf | 55 ------------------- .../WorkspaceExtensionsResources.zh-Hant.xlf | 55 ------------------- .../VisualBasicAddImportsService.vb | 11 +--- 119 files changed, 886 insertions(+), 1099 deletions(-) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/ArgumentGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/AttributeGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpCodeGenerationHelpers.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpCodeGenerationOptions.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpCodeGenerationPreferences.cs (95%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpCodeGenerationService.cs (99%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpCodeGenerationServiceFactory.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpDeclarationComparer.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpFlagsEnumGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/CSharpSyntaxGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/ConstructorGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/ConversionGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/DestructorGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/EnumMemberGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/EventGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/ExpressionGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/FieldGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/MethodGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/NamedTypeGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/NamespaceGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/OperatorGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/ParameterGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/PropertyGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/StatementGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/CSharp => CSharp/Portable}/CodeGeneration/TypeParameterGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/AbstractCodeGenerationService.cs (95%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs (99%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/AbstractFlagsEnumGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/CodeGenerationContext.cs (99%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/CodeGenerationDestination.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/CodeGenerationHelpers.cs (99%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/CodeGenerationOperatorKind.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/CodeGenerationOptions.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/CodeGenerationSymbolFactory.cs (99%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/CodeGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/ICodeGenerationService.cs (98%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/INamedTypeSymbolExtensions.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/LiteralSpecialValues.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/NullableSyntaxAnnotation.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs (98%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs (98%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationAttributeData.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs (96%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs (95%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationEventInfo.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs (97%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs (97%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs (98%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs (98%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs (95%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs (98%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs (97%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs (97%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationSymbol.cs (88%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs (98%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/SyntaxAnnotationExtensions.cs (52%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable}/CodeGeneration/TypeGenerator.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/ImportAdder => Core/Portable/Editing}/ImportAdderService.cs (100%) rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core => Core/Portable/Shared}/Extensions/ArrayExtensions.cs (100%) create mode 100644 src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs rename src/Workspaces/{SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration => Core/Portable/Shared/Extensions}/ITypeGenerator.cs (100%) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ArgumentGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/ArgumentGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ArgumentGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/ArgumentGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/AttributeGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/AttributeGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/AttributeGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/AttributeGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationHelpers.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationHelpers.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationHelpers.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationHelpers.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationOptions.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationOptions.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationOptions.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationOptions.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationPreferences.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationPreferences.cs similarity index 95% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationPreferences.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationPreferences.cs index a3bf3a4467dd6..b82d4859e943d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationPreferences.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationPreferences.cs @@ -8,14 +8,9 @@ using Microsoft.CodeAnalysis.CodeGeneration; using Microsoft.CodeAnalysis.CodeStyle; using Microsoft.CodeAnalysis.CSharp.CodeStyle; +using Microsoft.CodeAnalysis.Options; using Roslyn.Utilities; -#if CODE_STYLE -using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; -#else -using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; -#endif - namespace Microsoft.CodeAnalysis.CSharp.CodeGeneration { internal sealed class CSharpCodeGenerationPreferences : CodeGenerationPreferences diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationService.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationService.cs similarity index 99% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationService.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationService.cs index 2e88507378078..71ca665e7f620 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationService.cs +++ b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationService.cs @@ -15,16 +15,11 @@ using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.LanguageServices; +using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; -#if CODE_STYLE -using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; -#else -using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; -#endif - namespace Microsoft.CodeAnalysis.CSharp.CodeGeneration { internal partial class CSharpCodeGenerationService : AbstractCodeGenerationService diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationServiceFactory.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationServiceFactory.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpCodeGenerationServiceFactory.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpCodeGenerationServiceFactory.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpDeclarationComparer.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpDeclarationComparer.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpDeclarationComparer.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpDeclarationComparer.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpFlagsEnumGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpFlagsEnumGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpFlagsEnumGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpFlagsEnumGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpSyntaxGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/CSharpSyntaxGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/CSharpSyntaxGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConstructorGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/ConstructorGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConstructorGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/ConstructorGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConversionGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/ConversionGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ConversionGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/ConversionGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/DestructorGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/DestructorGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/DestructorGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/DestructorGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EnumMemberGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/EnumMemberGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EnumMemberGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/EnumMemberGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EventGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/EventGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/EventGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/EventGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ExpressionGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/ExpressionGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ExpressionGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/ExpressionGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/FieldGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/FieldGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/FieldGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/FieldGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/MethodGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/MethodGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/MethodGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/MethodGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamedTypeGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamedTypeGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/NamedTypeGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamespaceGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/NamespaceGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/NamespaceGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/NamespaceGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/OperatorGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/OperatorGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/OperatorGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/OperatorGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ParameterGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/ParameterGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/ParameterGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/ParameterGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/PropertyGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/PropertyGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/PropertyGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/PropertyGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/StatementGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/StatementGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/StatementGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/StatementGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/TypeParameterGenerator.cs b/src/Workspaces/CSharp/Portable/CodeGeneration/TypeParameterGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CodeGeneration/TypeParameterGenerator.cs rename to src/Workspaces/CSharp/Portable/CodeGeneration/TypeParameterGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService.cs b/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs similarity index 95% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService.cs rename to src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs index 180cac4cc6543..ef33ce30a9c2d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService.cs @@ -12,18 +12,12 @@ using Microsoft.CodeAnalysis.AddImport; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.LanguageServices; +using Microsoft.CodeAnalysis.Options; using Microsoft.CodeAnalysis.PooledObjects; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Simplification; using Roslyn.Utilities; -#if CODE_STYLE -using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; -#else -using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; -#endif - - namespace Microsoft.CodeAnalysis.CodeGeneration { internal abstract partial class AbstractCodeGenerationService : ICodeGenerationService @@ -160,7 +154,7 @@ protected static void CheckDeclarationNode(SyntaxNode destinat if (destination is not TDeclarationNode) { throw new ArgumentException( - string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_but_given_one_is_1, typeof(TDeclarationNode).Name, destination.GetType().Name), + string.Format(WorkspacesResources.Destination_type_must_be_a_0_but_given_one_is_1, typeof(TDeclarationNode).Name, destination.GetType().Name), nameof(destination)); } } @@ -178,7 +172,7 @@ protected static void CheckDeclarationNode not TDeclarationNode2) { throw new ArgumentException( - string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_or_a_1_but_given_one_is_2, + string.Format(WorkspacesResources.Destination_type_must_be_a_0_or_a_1_but_given_one_is_2, typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, destination.GetType().Name), nameof(destination)); } @@ -199,7 +193,7 @@ not TDeclarationNode2 and not TDeclarationNode3) { throw new ArgumentException( - string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_1_or_2_but_given_one_is_3, + string.Format(WorkspacesResources.Destination_type_must_be_a_0_1_or_2_but_given_one_is_3, typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, destination.GetType().Name), nameof(destination)); } @@ -217,7 +211,7 @@ not TDeclarationNode3 and not TDeclarationNode4) { throw new ArgumentException( - string.Format(WorkspaceExtensionsResources.Destination_type_must_be_a_0_1_2_or_3_but_given_one_is_4, + string.Format(WorkspacesResources.Destination_type_must_be_a_0_1_2_or_3_but_given_one_is_4, typeof(TDeclarationNode1).Name, typeof(TDeclarationNode2).Name, typeof(TDeclarationNode3).Name, typeof(TDeclarationNode4).Name, destination.GetType().Name), nameof(destination)); } @@ -235,7 +229,7 @@ private async Task GetEditAsync( if (destinationDeclaration == null) { - throw new ArgumentException(WorkspaceExtensionsResources.Could_not_find_location_to_generation_symbol_into); + throw new ArgumentException(WorkspacesResources.Could_not_find_location_to_generation_symbol_into); } var destinationTree = destinationDeclaration.SyntaxTree; @@ -251,13 +245,7 @@ private async Task GetEditAsync( if (context.AddImports) { var addImportsOptions = await AddImportPlacementOptions.FromDocumentAsync(newDocument, cancellationToken).ConfigureAwait(false); - var importAdder = newDocument.GetRequiredLanguageService(); - newDocument = await importAdder.AddImportsAsync( - newDocument, - SpecializedCollections.SingletonEnumerable(currentRoot.FullSpan), - ImportAdderService.Strategy.AddImportsFromSymbolAnnotations, - addImportsOptions, - cancellationToken).ConfigureAwait(false); + newDocument = await ImportAdder.AddImportsFromSymbolAnnotationAsync(newDocument, addImportsOptions, cancellationToken).ConfigureAwait(false); } return newDocument; @@ -482,17 +470,17 @@ protected static void CheckLocation(SyntaxNode destinationMember, [NotNull] Loca { if (location == null) { - throw new ArgumentException(WorkspaceExtensionsResources.No_location_provided_to_add_statements_to); + throw new ArgumentException(WorkspacesResources.No_location_provided_to_add_statements_to); } if (!location.IsInSource) { - throw new ArgumentException(WorkspaceExtensionsResources.Destination_location_was_not_in_source); + throw new ArgumentException(WorkspacesResources.Destination_location_was_not_in_source); } if (location.SourceTree != destinationMember.SyntaxTree) { - throw new ArgumentException(WorkspaceExtensionsResources.Destination_location_was_from_a_different_tree); + throw new ArgumentException(WorkspacesResources.Destination_location_was_from_a_different_tree); } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs b/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs similarity index 99% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs rename to src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs index 8325c7ef813b1..b3c34ae5a3963 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/AbstractCodeGenerationService_FindDeclaration.cs @@ -80,7 +80,7 @@ private bool CanAddTo(SyntaxNode? destination, Solution solution, CancellationTo // If we are avoiding generating into files marked as generated (but are still regular files) // then check accordingly. This is distinct from the prior check in that we as a fallback // will generate into these files is we have no alternative. - if (checkGeneratedCode && document.IsGeneratedCode(syntaxTree, cancellationToken)) + if (checkGeneratedCode && document.IsGeneratedCode(cancellationToken)) { return false; } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractFlagsEnumGenerator.cs b/src/Workspaces/Core/Portable/CodeGeneration/AbstractFlagsEnumGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/AbstractFlagsEnumGenerator.cs rename to src/Workspaces/Core/Portable/CodeGeneration/AbstractFlagsEnumGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationContext.cs b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationContext.cs similarity index 99% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationContext.cs rename to src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationContext.cs index 3162ef6cff9da..f1be39d46f4c0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationContext.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationContext.cs @@ -167,7 +167,7 @@ private static void CheckLocation(Location? location, string name) { if (location != null && !location.IsInSource) { - throw new ArgumentException(WorkspaceExtensionsResources.Location_must_be_null_or_from_source, name); + throw new ArgumentException(WorkspacesResources.Location_must_be_null_or_from_source, name); } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationDestination.cs b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationDestination.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationDestination.cs rename to src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationDestination.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationHelpers.cs similarity index 99% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs rename to src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationHelpers.cs index 3877b049c3e78..5194dbd5f5e1e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationHelpers.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationHelpers.cs @@ -119,7 +119,7 @@ public static bool TryGetDocumentationComment( ISymbol symbol, string commentToken, [NotNullWhen(true)] out string? comment, CancellationToken cancellationToken = default) { var xml = symbol.GetDocumentationCommentXml(cancellationToken: cancellationToken); - if (RoslynString.IsNullOrEmpty(xml)) + if (string.IsNullOrEmpty(xml)) { comment = null; return false; @@ -167,7 +167,7 @@ public static IEnumerable GetMembers(INamedTypeSymbol namedType) } return f1.HasConstantValue - ? Comparer.Default.Compare(f1.ConstantValue, f2.ConstantValue!) + ? Comparer.Default.Compare(f1.ConstantValue, f2.ConstantValue) : f1.Name.CompareTo(f2.Name); }).ToList(); } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOperatorKind.cs b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOperatorKind.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOperatorKind.cs rename to src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOperatorKind.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOptions.cs b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOptions.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationOptions.cs rename to src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationOptions.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationSymbolFactory.cs b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs similarity index 99% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationSymbolFactory.cs rename to src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs index cfa882aede743..2ef60b41f806d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationSymbolFactory.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerationSymbolFactory.cs @@ -6,13 +6,8 @@ using System.Collections.Generic; using System.Collections.Immutable; using System.Linq; -using Microsoft.CodeAnalysis.Shared.Extensions; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CodeGeneration { @@ -207,8 +202,8 @@ public static IMethodSymbol CreateOperatorSymbol( if (parameters.Length != expectedParameterCount) { var message = expectedParameterCount == 1 ? - WorkspaceExtensionsResources.Invalid_number_of_parameters_for_unary_operator : - WorkspaceExtensionsResources.Invalid_number_of_parameters_for_binary_operator; + WorkspacesResources.Invalid_number_of_parameters_for_unary_operator : + WorkspacesResources.Invalid_number_of_parameters_for_binary_operator; throw new ArgumentException(message, nameof(parameters)); } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerator.cs b/src/Workspaces/Core/Portable/CodeGeneration/CodeGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerator.cs rename to src/Workspaces/Core/Portable/CodeGeneration/CodeGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ICodeGenerationService.cs b/src/Workspaces/Core/Portable/CodeGeneration/ICodeGenerationService.cs similarity index 98% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ICodeGenerationService.cs rename to src/Workspaces/Core/Portable/CodeGeneration/ICodeGenerationService.cs index b83d17069bbdf..84b85e9e18d6d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ICodeGenerationService.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/ICodeGenerationService.cs @@ -6,13 +6,7 @@ using System.Threading; using System.Threading.Tasks; using Microsoft.CodeAnalysis.Host; - -#if CODE_STYLE -using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; -#else -using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; -#endif - +using Microsoft.CodeAnalysis.Options; namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/INamedTypeSymbolExtensions.cs b/src/Workspaces/Core/Portable/CodeGeneration/INamedTypeSymbolExtensions.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/INamedTypeSymbolExtensions.cs rename to src/Workspaces/Core/Portable/CodeGeneration/INamedTypeSymbolExtensions.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/LiteralSpecialValues.cs b/src/Workspaces/Core/Portable/CodeGeneration/LiteralSpecialValues.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/LiteralSpecialValues.cs rename to src/Workspaces/Core/Portable/CodeGeneration/LiteralSpecialValues.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/NullableSyntaxAnnotation.cs b/src/Workspaces/Core/Portable/CodeGeneration/NullableSyntaxAnnotation.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/NullableSyntaxAnnotation.cs rename to src/Workspaces/Core/Portable/CodeGeneration/NullableSyntaxAnnotation.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs similarity index 98% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs index d22dda6e7dceb..c040bccc0cdd0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractMethodSymbol.cs @@ -6,12 +6,7 @@ using System.Collections.Immutable; using System.Reflection.Metadata; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs similarity index 98% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs index 4599685e658f9..afb4c096ccf9d 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAbstractNamedTypeSymbol.cs @@ -7,12 +7,7 @@ using System; using System.Collections.Generic; using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationArrayTypeSymbol.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAttributeData.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAttributeData.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationAttributeData.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationAttributeData.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedMethodSymbol.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructedNamedTypeSymbol.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorInfo.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs similarity index 96% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs index be6376ceae81d..c1aa5ebb8ea00 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConstructorSymbol.cs @@ -5,12 +5,7 @@ #nullable disable using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs similarity index 95% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs index b41e77f7259c1..e8d7d0eecc34e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationConversionSymbol.cs @@ -5,12 +5,7 @@ #nullable disable using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorInfo.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationDestructorSymbol.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventInfo.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventInfo.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventInfo.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventInfo.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs similarity index 97% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs index efed6d2d9edc4..7b7949f8b12d3 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationEventSymbol.cs @@ -3,12 +3,7 @@ // See the LICENSE file in the project root for more information. using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldInfo.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs similarity index 97% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs index e5b1f1d092ba8..ceb695c493def 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationFieldSymbol.cs @@ -5,12 +5,7 @@ #nullable disable using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodInfo.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs similarity index 98% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs index c66f84eb97c5e..f17a9dabd284c 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationMethodSymbol.cs @@ -7,12 +7,7 @@ using System; using System.Collections.Immutable; using System.Diagnostics; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs similarity index 98% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs index 544470cbb8caa..9176276d0b62e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamedTypeSymbol.cs @@ -8,13 +8,8 @@ using System.Collections.Immutable; using System.Linq; using Microsoft.CodeAnalysis; -using Roslyn.Utilities; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceInfo.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs similarity index 95% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs index 4cf190debb603..f8d25434497b1 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceOrTypeSymbol.cs @@ -5,12 +5,7 @@ #nullable disable using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationNamespaceSymbol.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs similarity index 98% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs index c5968021388e8..2e99829026b52 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationOperatorSymbol.cs @@ -5,13 +5,8 @@ #nullable disable using System.Collections.Immutable; -using Roslyn.Utilities; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs similarity index 97% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs index 87e5dabf4dd0b..5c24c75230aaa 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationParameterSymbol.cs @@ -5,12 +5,7 @@ #nullable disable using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPointerTypeSymbol.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertyInfo.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs similarity index 97% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs index bef1da886c368..7909d1f0a6ca4 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationPropertySymbol.cs @@ -5,12 +5,7 @@ #nullable disable using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationSymbol.cs similarity index 88% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationSymbol.cs index bb8a7b16c9245..d120665f77ef4 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationSymbol.cs @@ -9,13 +9,8 @@ using System.Globalization; using System.Runtime.CompilerServices; using System.Threading; -using Microsoft.CodeAnalysis.Shared.Extensions; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif +using Microsoft.CodeAnalysis.Shared.Extensions; namespace Microsoft.CodeAnalysis.CodeGeneration { @@ -69,30 +64,12 @@ private static CodeGenerationSymbol AddAnnotationsTo( { annotationsTable.TryGetValue(originalDefinition, out var originalAnnotations); - annotations = CombineAnnotations(originalAnnotations, annotations); + annotations = SyntaxAnnotationExtensions.CombineAnnotations(originalAnnotations, annotations); annotationsTable.Add(newDefinition, annotations); return newDefinition; } - private static SyntaxAnnotation[] CombineAnnotations( - SyntaxAnnotation[] originalAnnotations, - SyntaxAnnotation[] newAnnotations) - { - if (!originalAnnotations.IsNullOrEmpty()) - { - // Make a new array (that includes the new annotations) and copy the original - // annotations into it. - var finalAnnotations = newAnnotations; - Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); - Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length); - - return finalAnnotations; - } - - return newAnnotations; - } - public abstract SymbolKind Kind { get; } public string Language => "Code Generation Agnostic Language"; diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeParameterSymbol.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs similarity index 98% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs rename to src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs index 93a364de72e54..efaa88336e672 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/Symbols/CodeGenerationTypeSymbol.cs @@ -5,12 +5,7 @@ #nullable disable using System.Collections.Immutable; - -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else using Microsoft.CodeAnalysis.Editing; -#endif namespace Microsoft.CodeAnalysis.CodeGeneration { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/SyntaxAnnotationExtensions.cs b/src/Workspaces/Core/Portable/CodeGeneration/SyntaxAnnotationExtensions.cs similarity index 52% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/SyntaxAnnotationExtensions.cs rename to src/Workspaces/Core/Portable/CodeGeneration/SyntaxAnnotationExtensions.cs index 018cc2f3bebc3..52f0d7a276b5c 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/SyntaxAnnotationExtensions.cs +++ b/src/Workspaces/Core/Portable/CodeGeneration/SyntaxAnnotationExtensions.cs @@ -19,5 +19,23 @@ public static TSymbol AddAnnotationToSymbol( var codeGenSymbol = (CodeGenerationSymbol)(object)symbol; return (TSymbol)(object)codeGenSymbol.WithAdditionalAnnotations(annotation); } + + internal static SyntaxAnnotation[] CombineAnnotations( + SyntaxAnnotation[] originalAnnotations, + SyntaxAnnotation[] newAnnotations) + { + if (!originalAnnotations.IsNullOrEmpty()) + { + // Make a new array (that includes the new annotations) and copy the original + // annotations into it. + var finalAnnotations = newAnnotations; + Array.Resize(ref finalAnnotations, originalAnnotations.Length + newAnnotations.Length); + Array.Copy(originalAnnotations, 0, finalAnnotations, newAnnotations.Length, originalAnnotations.Length); + + return finalAnnotations; + } + + return newAnnotations; + } } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/TypeGenerator.cs b/src/Workspaces/Core/Portable/CodeGeneration/TypeGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/TypeGenerator.cs rename to src/Workspaces/Core/Portable/CodeGeneration/TypeGenerator.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/ImportAdder/ImportAdderService.cs b/src/Workspaces/Core/Portable/Editing/ImportAdderService.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/ImportAdder/ImportAdderService.cs rename to src/Workspaces/Core/Portable/Editing/ImportAdderService.cs diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/ArrayExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/ArrayExtensions.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/ArrayExtensions.cs rename to src/Workspaces/Core/Portable/Shared/Extensions/ArrayExtensions.cs diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs new file mode 100644 index 0000000000000..e69f2ba59a96f --- /dev/null +++ b/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs @@ -0,0 +1,29 @@ +// Licensed to the .NET Foundation under one or more agreements. +// The .NET Foundation licenses this file to you under the MIT license. +// See the LICENSE file in the project root for more information. + +using System; +using System.Collections.Generic; +using Roslyn.Utilities; + +namespace Microsoft.CodeAnalysis.Shared.Extensions +{ + internal static class IListExtensions + { + public static int IndexOf(this IList list, Func predicate) + { + Contract.ThrowIfNull(list); + Contract.ThrowIfNull(predicate); + + for (var i = 0; i < list.Count; i++) + { + if (predicate(list[i])) + { + return i; + } + } + + return -1; + } + } +} diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs index dfd06aa29ec10..816b43f8e4ad7 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs @@ -55,6 +55,27 @@ public static bool CompatibleSignatureToDelegate(this IMethodSymbol method, INam return true; } + /// + /// Returns the methodSymbol and any partial parts. + /// + public static ImmutableArray GetAllMethodSymbolsOfPartialParts(this IMethodSymbol method) + { + if (method.PartialDefinitionPart != null) + { + Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); + return ImmutableArray.Create(method, method.PartialDefinitionPart); + } + else if (method.PartialImplementationPart != null) + { + Debug.Assert(!Equals(method.PartialImplementationPart, method)); + return ImmutableArray.Create(method.PartialImplementationPart, method); + } + else + { + return ImmutableArray.Create(method); + } + } + public static IMethodSymbol RenameTypeParameters(this IMethodSymbol method, ImmutableArray newNames) { if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs index abf45b793acf9..5071112465fb2 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/ISymbolExtensions.cs @@ -25,6 +25,17 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class ISymbolExtensions { + public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol) + { + return new DeclarationModifiers( + isStatic: symbol.IsStatic, + isAbstract: symbol.IsAbstract, + isUnsafe: symbol.RequiresUnsafeModifier(), + isVirtual: symbol.IsVirtual, + isOverride: symbol.IsOverride, + isSealed: symbol.IsSealed); + } + /// /// Checks a given symbol for browsability based on its declaration location, attributes /// explicitly limiting browsability, and whether showing of advanced members is enabled. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ITypeGenerator.cs b/src/Workspaces/Core/Portable/Shared/Extensions/ITypeGenerator.cs similarity index 100% rename from src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/ITypeGenerator.cs rename to src/Workspaces/Core/Portable/Shared/Extensions/ITypeGenerator.cs diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs index 84e5de00012ef..1ceb1db50bb73 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs @@ -16,6 +16,24 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class SourceTextExtensions { + /// + /// Returns the leading whitespace of the line located at the specified position in the given snapshot. + /// + public static string GetLeadingWhitespaceOfLineAtPosition(this SourceText text, int position) + { + Contract.ThrowIfNull(text); + + var line = text.Lines.GetLineFromPosition(position); + var linePosition = line.GetFirstNonWhitespacePosition(); + if (!linePosition.HasValue) + { + return line.ToString(); + } + + var lineText = line.ToString(); + return lineText.Substring(0, linePosition.Value - line.Start); + } + public static void GetLineAndOffset(this SourceText text, int position, out int lineNumber, out int offset) { var line = text.Lines.GetLineFromPosition(position); diff --git a/src/Workspaces/Core/Portable/WorkspacesResources.resx b/src/Workspaces/Core/Portable/WorkspacesResources.resx index 15180f35cddfa..06deb5218f886 100644 --- a/src/Workspaces/Core/Portable/WorkspacesResources.resx +++ b/src/Workspaces/Core/Portable/WorkspacesResources.resx @@ -129,9 +129,36 @@ Cycle detected in extensions + + Destination type must be a {0}, but given one is {1}. + + + Destination type must be a {0} or a {1}, but given one is {2}. + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + + + Could not find location to generation symbol into. + + + No location provided to add statements to. + + + Destination location was not in source. + + + Destination location was from a different tree. + Node is of the wrong type. + + Location must be null or from source. + Duplicate source file '{0}' in project '{1}' @@ -282,6 +309,12 @@ Cannot generate code for unsupported operator '{0}' + + Invalid number of parameters for binary operator. + + + Invalid number of parameters for unary operator. + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf index 976b6bf7c4770..778c4b26985b7 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.cs.xlf @@ -52,6 +52,11 @@ DateTimeKind musí být Utc + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Cílový typ musí být {0}, {1}, {2} nebo {3}, ale zadaný typ je {4}. + + Document does not support syntax trees Dokument nepodporuje stromy syntaxe. @@ -132,11 +137,51 @@ V rozšířeních se zjistil cyklus. + + Destination type must be a {0}, but given one is {1}. + Cílový typ musí být {0}, ale zadaný typ je {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Cílový typ musí být {0} nebo {1}, ale zadaný typ je {2}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Cílový typ musí být {0}, {1} nebo {2}, ale zadaný typ je {3}. + + + + Could not find location to generation symbol into. + Nenašlo se umístění, do kterého by se vygeneroval symbol. + + + + No location provided to add statements to. + Není zadané žádné umístění, kam by se daly přidávat příkazy. + + + + Destination location was not in source. + Cílové umístění není ve zdroji. + + + + Destination location was from a different tree. + Cílové umístění pochází z jiného stromu. + + Node is of the wrong type. Uzel je chybného typu. + + Location must be null or from source. + Umístění musí být null nebo ze zdroje. + + Duplicate source file '{0}' in project '{1}' Duplicitní zdrojový soubor {0} v projektu {1} @@ -407,6 +452,16 @@ Nejde generovat kód pro nepodporovaný operátor {0}. + + Invalid number of parameters for binary operator. + Neplatný počet parametrů pro binární operátor + + + + Invalid number of parameters for unary operator. + Neplatný počet parametrů pro unární operátor + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Nejde otevřít projekt {0}, protože přípona souboru {1} není přidružená k jazyku. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf index a4f8bf615ef1a..3b33ebc674923 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.de.xlf @@ -52,6 +52,11 @@ "DateTimeKind" muss UTC sein. + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Der Zieltyp muss "{0}", "{1}", "{2}" oder "{3}" lauten. Es wurde jedoch "{4}" angegeben. + + Document does not support syntax trees Das Dokument unterstützt keine Syntaxstrukturen. @@ -132,11 +137,51 @@ Zyklus in Erweiterungen entdeckt + + Destination type must be a {0}, but given one is {1}. + Zieltyp muss {0} sein. Es wurde jedoch {1} angegeben. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Zieltyp muss {0} oder {1} sein. Es wurde jedoch {2} angegeben. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Zieltyp muss {0}, {1} oder {2} sein. Es wurde jedoch {3} angegeben. + + + + Could not find location to generation symbol into. + Konnte keinen Ort finden, in den das Symbol generiert werden kann. + + + + No location provided to add statements to. + Kein Ort angegeben, zu dem Anweisungen hinzugefügt werden. + + + + Destination location was not in source. + Zielort war nicht in Quelle. + + + + Destination location was from a different tree. + Zielort stammt aus anderem Baum. + + Node is of the wrong type. Knoten hat den falschen Typ. + + Location must be null or from source. + Ort muss null oder von Quelle sein. + + Duplicate source file '{0}' in project '{1}' Doppelte Quelldatei "{0}" in Projekt "{1}" @@ -407,6 +452,16 @@ Kann keinen Code für nicht unterstützten Operator "{0}" generieren + + Invalid number of parameters for binary operator. + Ungültige Parameteranzahl für binären Operator. + + + + Invalid number of parameters for unary operator. + Ungültige Parameteranzahl für unären Operator. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Projekt "{0}" kann nicht geöffnet werden, da die Dateierweiterung "{1}" keiner Sprache zugeordnet ist. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf index c476ae51972df..28f0516522f55 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.es.xlf @@ -52,6 +52,11 @@ DateTimeKind debe ser Utc + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + El tipo de destino debe ser una instancia de {0}, {1}, {2} o {3}, pero el proporcionado es {4}. + + Document does not support syntax trees El documento no admite árboles de sintaxis @@ -132,11 +137,51 @@ Detectado ciclo en extensiones + + Destination type must be a {0}, but given one is {1}. + El tipo de destino debe ser un {0}, pero el proporcionado es {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + El tipo de destino debe ser un {0} o un {1}, pero el proporcionado es {2}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + El tipo de destino debe ser un {0}, {1} o {2}, pero el proporcionado es {3}. + + + + Could not find location to generation symbol into. + No se pudo encontrar una ubicación en la que generar un símbolo. + + + + No location provided to add statements to. + No se ha proporcionado ubicación a la que agregar instrucciones. + + + + Destination location was not in source. + La ubicación de destino no estaba en el código fuente. + + + + Destination location was from a different tree. + La ubicación de destino era de otro árbol. + + Node is of the wrong type. El nodo es del tipo erróneo. + + Location must be null or from source. + La ubicación debe ser null o del código fuente. + + Duplicate source file '{0}' in project '{1}' Archivo de código fuente '{0}' duplicado en el proyecto '{1}' @@ -407,6 +452,16 @@ No se puede generar código para el operador no compatible '{0}' + + Invalid number of parameters for binary operator. + Número de parámetros no válido para el operador binario. + + + + Invalid number of parameters for unary operator. + Número de parámetros no válido para el operador unario. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. No se puede abrir el proyecto '{0}' porque la extensión de archivo '{1}' no está asociada a un lenguaje. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf index 198c24f7a56c4..b28c49f5e07d0 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.fr.xlf @@ -52,6 +52,11 @@ DateTimeKind doit être UTC + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Le type de destination doit être {0}, {1}, {2} ou {3}, mais le type spécifié est {4}. + + Document does not support syntax trees Le document ne prend pas en charge les arborescences de syntaxe @@ -132,11 +137,51 @@ Cycle détecté dans les extensions + + Destination type must be a {0}, but given one is {1}. + Le type de destination doit être un {0}, mais le type donné est {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Le type de destination doit être un {0} ou un {1}, mais le type donné est {2}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Le type de destination doit être un {0}, {1} ou {2}, mais le type donné est {3}. + + + + Could not find location to generation symbol into. + L'emplacement dans lequel générer le symbole est introuvable. + + + + No location provided to add statements to. + Aucun emplacement n'a été fourni pour l'ajout d'instructions. + + + + Destination location was not in source. + L'emplacement de destination n'était pas dans la source. + + + + Destination location was from a different tree. + L'emplacement de destination provient d'une arborescence différente. + + Node is of the wrong type. Le type de nœud est incorrect. + + Location must be null or from source. + L'emplacement doit être null ou dans la source. + + Duplicate source file '{0}' in project '{1}' Dupliquer le fichier source '{0}' dans le projet '{1}' @@ -407,6 +452,16 @@ Impossible de générer du code pour l'opérateur non pris en charge '{0}' + + Invalid number of parameters for binary operator. + Nombre de paramètres non valide pour l'opérateur binaire. + + + + Invalid number of parameters for unary operator. + Nombre de paramètres non valide pour l'opérateur unaire. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Impossible d'ouvrir le projet '{0}', car l'extension de fichier '{1}' n'est pas associée à un langage. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf index 6c08647a92158..833722dc62843 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.it.xlf @@ -52,6 +52,11 @@ Il valore di DateTimeKind deve essere Utc + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Il tipo di destinazione deve essere {0}, {1}, {2} o {3}, ma quello specificato è {4}. + + Document does not support syntax trees Il documento non supporta alberi di sintassi @@ -132,11 +137,51 @@ È stato rilevato un ciclo nelle estensioni + + Destination type must be a {0}, but given one is {1}. + Il tipo di destinazione deve essere {0}, ma quello specificato è {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Il tipo di destinazione deve essere {0} o {1}, ma quello specificato è {2}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Il tipo di destinazione deve essere {0}, {1} o {2}, ma quello specificato è {3}. + + + + Could not find location to generation symbol into. + Non è stata trovata la posizione in cui generare il simbolo. + + + + No location provided to add statements to. + Non sono state specificate posizioni in cui aggiungere istruzioni. + + + + Destination location was not in source. + La posizione di destinazione non è inclusa nell'origine. + + + + Destination location was from a different tree. + La posizione di destinazione è in un albero diverso. + + Node is of the wrong type. Il tipo del nodo è errato. + + Location must be null or from source. + La posizione deve essere Null o derivare dall'origine. + + Duplicate source file '{0}' in project '{1}' File di origine '{0}' duplicato nel progetto '{1}' @@ -407,6 +452,16 @@ Non è possibile generare il codice per l'operatore '{0}' non supportato + + Invalid number of parameters for binary operator. + Il numero di parametri per l'operatore binario non è valido. + + + + Invalid number of parameters for unary operator. + Il numero di parametri per l'operatore unario non è valido. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Non è possibile aprire il progetto '{0}' perché l'estensione di file '{1}' non è associata a un linguaggio. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf index 1d5921e0ca513..055f08def46cc 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ja.xlf @@ -52,6 +52,11 @@ DateTimeKind は Utc にする必要があります + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + ターゲットの型は {0}、{1}、{2}、または {3} である必要がありますが、{4} が指定されています。 + + Document does not support syntax trees ドキュメントでは構文ツリーがサポートされません @@ -132,11 +137,51 @@ 拡張機能で循環が検出されました + + Destination type must be a {0}, but given one is {1}. + ターゲットの型は {0} である必要がありますが、{1} が指定されています。 + + + + Destination type must be a {0} or a {1}, but given one is {2}. + ターゲットの型は {0} または {1} である必要がありますが、{2} が指定されています。 + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + ターゲットの型は {0}、{1}、または {2} である必要がありますが、{3} が指定されています。 + + + + Could not find location to generation symbol into. + シンボルの生成先が見つかりませんでした。 + + + + No location provided to add statements to. + ステートメントを追加する場所がありません。 + + + + Destination location was not in source. + 追加先の場所は、ソース内ではありません。 + + + + Destination location was from a different tree. + ターゲットの場所は、別のツリーでした。 + + Node is of the wrong type. ノードの種類が正しくありません。 + + Location must be null or from source. + 場所は Null であるか、ソースからでなければなりません。 + + Duplicate source file '{0}' in project '{1}' プロジェクト '{1}' でソース ファイル '{0}' が重複しています @@ -407,6 +452,16 @@ サポートされない演算子 '{0}' のコードは生成できません + + Invalid number of parameters for binary operator. + 二項演算子のパラメーターの数が無効です。 + + + + Invalid number of parameters for unary operator. + 単項演算子のパラメーターの数が無効です。 + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. ファイルの拡張子 '{1}' が言語に関連付けられていないため、プロジェクト '{0}' を開くことができません。 diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf index 9d973075e113c..27fe20e964e11 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ko.xlf @@ -52,6 +52,11 @@ DateTimeKind는 UTC여야 합니다. + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + 대상 형식은 {0}, {1}, {2} 또는 {3}이어야 하지만 지정된 대상 형식은 {4}입니다. + + Document does not support syntax trees 문서가 구문 트리를 지원하지 않음 @@ -132,11 +137,51 @@ 확장에서 순환 발견 + + Destination type must be a {0}, but given one is {1}. + 대상 형식은 {0}이어야 하지만 지정된 형식은 {1}입니다. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + 대상 형식은 {0} 또는 {1}이어야 하지만 지정된 형식은 {2}입니다. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + 대상 형식은 {0}, {1} 또는 {2}이어야 하지만 지정된 형식은 {3}입니다. + + + + Could not find location to generation symbol into. + 기호를 생성할 위치를 찾을 수 없습니다. + + + + No location provided to add statements to. + 문을 추가할 위치가 제공되지 않았습니다. + + + + Destination location was not in source. + 대상 위치가 소스에 없습니다. + + + + Destination location was from a different tree. + 다른 트리에서 온 대상 위치입니다. + + Node is of the wrong type. 잘못된 형식의 노드입니다. + + Location must be null or from source. + 위치는 null이거나 소스에 있어야 합니다. + + Duplicate source file '{0}' in project '{1}' '{1}' 프로젝트에서 중복된 '{0}' 소스 파일입니다. @@ -407,6 +452,16 @@ 지원되지 않는 '{0}' 연산자에 대한 코드를 생성할 수 없습니다. + + Invalid number of parameters for binary operator. + 이진 연산자에 대해 잘못된 매개 변수 수입니다. + + + + Invalid number of parameters for unary operator. + 단항 연산자에 대해 잘못된 매개 변수 수입니다. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. '{1}' 파일 확장명이 언어에 연결되어 있지 않아 '{0}' 프로젝트를 열 수 없습니다. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf index f29f635432c97..bf6c1799e126d 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pl.xlf @@ -52,6 +52,11 @@ Element DateTimeKind musi mieć wartość Utc + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Typ docelowy musi być elementem {0}, {1}, {2} lub {3}, ale podano element {4}. + + Document does not support syntax trees Dokument nie obsługuje drzew składni @@ -132,11 +137,51 @@ W rozszerzeniach wykryto cykl + + Destination type must be a {0}, but given one is {1}. + Typ docelowy musi być elementem {0}, ale podano element {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Typ docelowy musi być elementem {0} lub {1}, ale podano element {2}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Typ docelowy musi być elementem {0}, {1} lub {2}, ale podano element {3}. + + + + Could not find location to generation symbol into. + Nie można znaleźć lokalizacji do wygenerowania symbolu. + + + + No location provided to add statements to. + Nie podano lokalizacji, do których można dodać instrukcje. + + + + Destination location was not in source. + Lokalizacja docelowa nie znajdowała się w źródle. + + + + Destination location was from a different tree. + Lokalizacja docelowa pochodziła z innego drzewa. + + Node is of the wrong type. Węzeł ma nieprawidłowy typ. + + Location must be null or from source. + Lokalizacja musi mieć wartość null lub pochodzić ze źródła. + + Duplicate source file '{0}' in project '{1}' Zduplikowany plik źródłowy „{0}” w projekcie „{1}” @@ -407,6 +452,16 @@ Nie można wygenerować kodu dla nieobsługiwanego operatora „{0}” + + Invalid number of parameters for binary operator. + Nieprawidłowa liczba parametrów operatora binarnego. + + + + Invalid number of parameters for unary operator. + Nieprawidłowa liczba parametrów operatora jednoargumentowego. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Nie można otworzyć projektu „{0}”, ponieważ rozszerzenie pliku „{1}” nie jest skojarzone z językiem. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf index 0debb02a468f1..4079e600970ba 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.pt-BR.xlf @@ -52,6 +52,11 @@ DateTimeKind deve ser Utc + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + O tipo de destino precisa ser {0}, {1}, {2} ou {3}, mas o tipo fornecido é {4}. + + Document does not support syntax trees O documento não dá suporte a árvores de sintaxe @@ -132,11 +137,51 @@ Ciclo detectado em extensões + + Destination type must be a {0}, but given one is {1}. + O tipo de destino deve ser um {0}, mas o tipo fornecido é {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + O tipo de destino deve ser um {0} ou um {1}, mas o tipo fornecido é {2}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + O tipo de destino deve ser um {0}, {1} ou {2}, mas o tipo fornecido é {3}. + + + + Could not find location to generation symbol into. + Não foi possível encontrar o local para o símbolo de geração. + + + + No location provided to add statements to. + Nenhum local fornecido para o qual adicionar instruções. + + + + Destination location was not in source. + Local de destino não estava na origem. + + + + Destination location was from a different tree. + Local de destino era de uma árvore diferente. + + Node is of the wrong type. O nó é do tipo errado. + + Location must be null or from source. + Local deve ser nulo ou da fonte. + + Duplicate source file '{0}' in project '{1}' Arquivo de origem duplicado "{0}" no projeto "{1}" @@ -407,6 +452,16 @@ Não é possível gerar código para operador não suportado "{0}" + + Invalid number of parameters for binary operator. + Número inválido de parâmetros para o operador binário. + + + + Invalid number of parameters for unary operator. + Número inválido de parâmetros para o operador unário. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Não é possível abrir o projeto "{0}" porque a extensão de arquivo "{1}" não está associada a um idioma. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf index a15d12cd10569..f84d7e5a5fce0 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.ru.xlf @@ -52,6 +52,11 @@ Параметр DateTimeKind должен содержать время и дату в формате UTC + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Конечный тип должен быть {0}, {1}, {2} или {3}, но указан {4}. + + Document does not support syntax trees Документ не поддерживает синтаксические деревья. @@ -132,11 +137,51 @@ В выражениях обнаружен цикл + + Destination type must be a {0}, but given one is {1}. + Конечный тип должен быть {0}, но указан {1}. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Конечный тип должен быть {0} или {1}, но указан {2}. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Конечный тип должен быть {0}, {1} или {2}, но указан {3}. + + + + Could not find location to generation symbol into. + Не удалось найти расположение для создания символа. + + + + No location provided to add statements to. + Для добавления операторов не было указано расположение. + + + + Destination location was not in source. + Целевое расположение не найдено в источнике. + + + + Destination location was from a different tree. + Целевое расположение находилось в другом дереве. + + Node is of the wrong type. Узел имеет неверный тип. + + Location must be null or from source. + Расположение должно иметь значение Null или источника. + + Duplicate source file '{0}' in project '{1}' Дублирование исходного файла "{0}" в проекте "{1}" @@ -407,6 +452,16 @@ Невозможно сформировать код для неподдерживаемого оператора "{0}" + + Invalid number of parameters for binary operator. + Недопустимое число параметров для бинарного оператора. + + + + Invalid number of parameters for unary operator. + Недопустимое число параметров для унарного оператора. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Не удается открыть проект "{0}", так как расширение файла "{1}" не связано с языком. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf index 2e6aea73cea58..134a34cbdb11b 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.tr.xlf @@ -52,6 +52,11 @@ DateTimeKind Utc olmalıdır + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + Hedef tür bir {0}, {1}, {2} veya {3} olmalı, ancak {4} belirtildi. + + Document does not support syntax trees Belge, söz dizimi ağaçlarını desteklemiyor @@ -132,11 +137,51 @@ Uzantılarda döngü algılandı + + Destination type must be a {0}, but given one is {1}. + Hedef tür bir {0} olmalı, ancak {1} belirtildi. + + + + Destination type must be a {0} or a {1}, but given one is {2}. + Hedef tür bir {0} veya {1} olmalı, ancak {2} belirtildi. + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + Hedef tür bir {0}, {1} veya {2} olmalı, ancak {3} belirtildi. + + + + Could not find location to generation symbol into. + Sembolün üretileceği konum bulunamadı. + + + + No location provided to add statements to. + Deyimlerin ekleneceği konum sağlanmadı. + + + + Destination location was not in source. + Hedef konum kaynakta değildi. + + + + Destination location was from a different tree. + Hedef konum farklı bir ağaçtandı. + + Node is of the wrong type. Düğüm yanlış türde. + + Location must be null or from source. + Konum boş veya kaynağa ait olmalıdır. + + Duplicate source file '{0}' in project '{1}' '{1}' projesinde yinelenen kaynak dosyası '{0}' @@ -407,6 +452,16 @@ Desteklenmeyen operatör '{0}' için kod üretilemiyor + + Invalid number of parameters for binary operator. + İkili operatör için parametre sayısı geçersiz. + + + + Invalid number of parameters for unary operator. + Birli operatör için parametre sayısı geçersiz. + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. Dosya uzantısı '{1}' bir dil ile ilişkili olmadığı için '{0}' projesi açılamıyor. diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf index 2b3834b392764..d7f065176dd1f 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hans.xlf @@ -52,6 +52,11 @@ DateTimeKind 必须是 Utc + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + 目标类型必须是 {0}、{1}、{2} 或 {3},但给定类型是 {4}。 + + Document does not support syntax trees 文档不支持语法树 @@ -132,11 +137,51 @@ 在扩展中检测到循环 + + Destination type must be a {0}, but given one is {1}. + 目标类型必须是 {0},但给定类型是 {1}。 + + + + Destination type must be a {0} or a {1}, but given one is {2}. + 目标类型必须是 {0} 或 {1},但给定类型是 {2}。 + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + 目标类型必须是 {0}、{1} 或 {2},但给定类型是 {3}。 + + + + Could not find location to generation symbol into. + 找不到符号生成到的位置。 + + + + No location provided to add statements to. + 未提供语句要添加到的位置。 + + + + Destination location was not in source. + 目标位置不在源中。 + + + + Destination location was from a different tree. + 目标位置来自不同的树。 + + Node is of the wrong type. 节点类型不正确。 + + Location must be null or from source. + 位置必须为 null 或来自源。 + + Duplicate source file '{0}' in project '{1}' 项目“{1}”中源文件“{0}”重复 @@ -407,6 +452,16 @@ 无法为不受支持的运算符“{0}”生成代码 + + Invalid number of parameters for binary operator. + 参数数目对二元运算符无效。 + + + + Invalid number of parameters for unary operator. + 参数数目对一元运算符无效。 + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. 无法打开项目“{0}”, 因为文件扩展名“{1}”没有与某种语言关联。 diff --git a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf index fdf0efabef1d5..939d15173014c 100644 --- a/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf +++ b/src/Workspaces/Core/Portable/xlf/WorkspacesResources.zh-Hant.xlf @@ -52,6 +52,11 @@ DateTimeKind 必須是 Utc + + Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. + 目的地類型必須是 {0}、{1}、{2} 或 {3},但提供的類型是 {4}。 + + Document does not support syntax trees 文件不支援語法樹 @@ -132,11 +137,51 @@ 在擴充功能中偵測到循環 + + Destination type must be a {0}, but given one is {1}. + 目的地類型必須是 {0},但提供的是 {1}。 + + + + Destination type must be a {0} or a {1}, but given one is {2}. + 目的地類型必須是 {0} 或 {1},但提供的是 {2}。 + + + + Destination type must be a {0}, {1} or {2}, but given one is {3}. + 目的地類型必須是 {0}、{1} 或 {2},但提供的是 {3}。 + + + + Could not find location to generation symbol into. + 找不到產生符號目的地位置。 + + + + No location provided to add statements to. + 未提供加入陳述式的位置。 + + + + Destination location was not in source. + 目的地位置不在來源中。 + + + + Destination location was from a different tree. + 目的地位置來自不同的樹狀目錄。 + + Node is of the wrong type. 節點類型不正確。 + + Location must be null or from source. + 位置必須是 null 或源自來源。 + + Duplicate source file '{0}' in project '{1}' 複製專案 '{1}' 中的原始程式檔 '{0}' @@ -407,6 +452,16 @@ 無法產生不受支援之運算子 '{0}' 的程式碼 + + Invalid number of parameters for binary operator. + 二元運算子的參數數目無效。 + + + + Invalid number of parameters for unary operator. + 一元運算子的參數數目無效。 + + Cannot open project '{0}' because the file extension '{1}' is not associated with a language. 無法開啟專案 '{0}',因為副檔名 '{1}' 未與語言相關聯。 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs index 923f603901323..34d3c61dd7f1a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs @@ -3,8 +3,6 @@ // See the LICENSE file in the project root for more information. using System; -using System.Collections.Immutable; -using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis.LanguageServices; @@ -12,27 +10,6 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class IMethodSymbolExtensions { - /// - /// Returns the methodSymbol and any partial parts. - /// - public static ImmutableArray GetAllMethodSymbolsOfPartialParts(this IMethodSymbol method) - { - if (method.PartialDefinitionPart != null) - { - Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); - return ImmutableArray.Create(method, method.PartialDefinitionPart); - } - else if (method.PartialImplementationPart != null) - { - Debug.Assert(!Equals(method.PartialImplementationPart, method)); - return ImmutableArray.Create(method.PartialImplementationPart, method); - } - else - { - return ImmutableArray.Create(method); - } - } - /// /// Returns true for void returning methods with two parameters, where /// the first parameter is of type and the second diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs index ccae323b36542..d90f5d03d5f67 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ISymbolExtensions.cs @@ -12,27 +12,10 @@ using Microsoft.CodeAnalysis.Shared.Utilities; using Roslyn.Utilities; -#if CODE_STYLE -using Microsoft.CodeAnalysis.Internal.Editing; -#else -using Microsoft.CodeAnalysis.Editing; -#endif - namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class ISymbolExtensions { - public static DeclarationModifiers GetSymbolModifiers(this ISymbol symbol) - { - return new DeclarationModifiers( - isStatic: symbol.IsStatic, - isAbstract: symbol.IsAbstract, - isUnsafe: symbol.RequiresUnsafeModifier(), - isVirtual: symbol.IsVirtual, - isOverride: symbol.IsOverride, - isSealed: symbol.IsSealed); - } - public static string ToNameDisplayString(this ISymbol symbol) => symbol.ToDisplayString(SymbolDisplayFormats.NameFormat); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs index b9695d23e8e1a..0a3dd965b3f54 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs @@ -62,21 +62,5 @@ public static bool TryRemoveFirst(this IList list, Func(this IList list, Func predicate) - { - Contract.ThrowIfNull(list); - Contract.ThrowIfNull(predicate); - - for (var i = 0; i < list.Count; i++) - { - if (predicate(list[i])) - { - return i; - } - } - - return -1; - } } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs index 89325f2535625..6f39379e5a29e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs @@ -5,30 +5,11 @@ using System; using System.Threading; using Microsoft.CodeAnalysis.Text; -using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class SourceTextExtensions { - /// - /// Returns the leading whitespace of the line located at the specified position in the given snapshot. - /// - public static string GetLeadingWhitespaceOfLineAtPosition(this SourceText text, int position) - { - Contract.ThrowIfNull(text); - - var line = text.Lines.GetLineFromPosition(position); - var linePosition = line.GetFirstNonWhitespacePosition(); - if (!linePosition.HasValue) - { - return line.ToString(); - } - - var lineText = line.ToString(); - return lineText.Substring(0, linePosition.Value - line.Start); - } - public static bool OverlapsHiddenPosition( this SourceText text, TextSpan span, Func isPositionHidden, CancellationToken cancellationToken) { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems index c50917f98c57d..f4ccbf505feb8 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/CSharpWorkspaceExtensions.projitems @@ -9,31 +9,6 @@ Microsoft.CodeAnalysis.CSharp.Shared - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs index 449d8c4fbae50..1b726becb9d2b 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs @@ -15,13 +15,6 @@ using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; -#if CODE_STYLE -using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; -#else -using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; -#endif - - namespace Microsoft.CodeAnalysis.CSharp.AddImport { [ExportLanguageService(typeof(IAddImportsService), LanguageNames.CSharp), Shared] @@ -34,10 +27,12 @@ public CSharpAddImportsService() { } - public override bool PlaceImportsInsideNamespaces(OptionSet optionSet) +#if !CODE_STYLE + public override bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet) { return optionSet.GetOption(CSharpCodeStyleOptions.PreferredUsingDirectivePlacement).Value == AddImportPlacement.InsideNamespace; } +#endif // C# doesn't have global imports. protected override ImmutableArray GetGlobalImports(Compilation compilation, SyntaxGenerator generator) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs index e85c1d81aafb2..3b36e4cff23a0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/CodeGeneration/CodeGenerationPreferences.cs @@ -7,7 +7,6 @@ using Roslyn.Utilities; using Microsoft.CodeAnalysis.Shared.Extensions; using Microsoft.CodeAnalysis.Editing; -using Microsoft.CodeAnalysis.Diagnostics; #if CODE_STYLE using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; @@ -35,21 +34,18 @@ public CodeGenerationPreferences(OptionSet options) public bool PlaceSystemNamespaceFirst => Options.GetOption(GenerationOptions.PlaceSystemNamespaceFirst, Language); +#if !CODE_STYLE public abstract CodeGenerationOptions GetOptions(CodeGenerationContext context); public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) { var parseOptions = document.Project.ParseOptions; Contract.ThrowIfNull(parseOptions); -#if CODE_STYLE - var tree = await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false); - var documentOptions = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(tree, cancellationToken); -#else - var documentOptions = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); -#endif + var documentOptions = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); var codeGenerationService = document.GetRequiredLanguageService(); return codeGenerationService.GetPreferences(parseOptions, documentOptions); } +#endif } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs index ba930e585ddbf..baa5040bc0af0 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/Extensions/DocumentExtensions.cs @@ -187,12 +187,6 @@ public static bool IsGeneratedCode(this Document document, CancellationToken can } #endif - public static bool IsGeneratedCode(this Document document, SyntaxTree tree, CancellationToken cancellationToken) - { - var generatedCodeRecognitionService = document.GetLanguageService(); - return generatedCodeRecognitionService?.IsGeneratedCode(tree, document, cancellationToken) == true; - } - public static async Task IsGeneratedCodeAsync(this Document document, CancellationToken cancellationToken) { var generatedCodeRecognitionService = document.GetLanguageService(); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs index 04763463f1f96..68eac08935bf7 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs @@ -10,12 +10,6 @@ using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Shared.Extensions; -#if CODE_STYLE -using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; -#else -using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; -#endif - namespace Microsoft.CodeAnalysis.AddImport { internal abstract class AbstractAddImportsService @@ -35,7 +29,9 @@ protected AbstractAddImportsService() protected abstract SyntaxList GetExterns(SyntaxNode node); protected abstract bool IsStaticUsing(TUsingOrAliasSyntax usingOrAlias); - public abstract bool PlaceImportsInsideNamespaces(OptionSet optionSet); +#if !CODE_STYLE + public abstract bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet); +#endif private bool IsSimpleUsing(TUsingOrAliasSyntax usingOrAlias) => !IsAlias(usingOrAlias) && !IsStaticUsing(usingOrAlias); private bool IsAlias(TUsingOrAliasSyntax usingOrAlias) => GetAlias(usingOrAlias) != null; diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs index ceee0a3cd7a2e..489d167099e4b 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs @@ -6,18 +6,11 @@ using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; -using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; -#if CODE_STYLE -using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; -#else -using Microsoft.CodeAnalysis.Options; -#endif - namespace Microsoft.CodeAnalysis.AddImport { [DataContract] @@ -30,7 +23,7 @@ internal record struct AddImportPlacementOptions( public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) => FromDocument(document, await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false)); - public static AddImportPlacementOptions FromDocument(Document document, OptionSet documentOptions) + public static AddImportPlacementOptions FromDocument(Document document, Options.OptionSet documentOptions) { var service = document.GetRequiredLanguageService(); @@ -48,22 +41,14 @@ private static bool CanAddImportsInHiddenRegions(Document document) var spanMapper = document.Services.GetService(); return spanMapper != null && spanMapper.SupportsMappingImportDirectives; } -#else - public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) - { - var service = document.GetRequiredLanguageService(); - var options = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false), cancellationToken); - return new( - PlaceSystemNamespaceFirst: options.GetOption(GenerationOptions.PlaceSystemNamespaceFirst), - PlaceImportsInsideNamespaces: service.PlaceImportsInsideNamespaces(options), - AllowInHiddenRegions: false); - } #endif } internal interface IAddImportsService : ILanguageService { - bool PlaceImportsInsideNamespaces(OptionSet optionSet); +#if !CODE_STYLE + bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet); +#endif /// /// Returns true if the tree already has an existing import syntactically equivalent to diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs index 12819c4d7f6c8..3547f536f7542 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/AbstractGeneratedCodeRecognitionService.cs @@ -28,7 +28,7 @@ public async Task IsGeneratedCodeAsync(Document document, CancellationToke return IsGeneratedCode(syntaxTree, document, cancellationToken); } - public bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken) + private static bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken) { var syntaxFacts = document.GetLanguageService(); return syntaxTree.IsGeneratedCode(document.Project.AnalyzerOptions, syntaxFacts, cancellationToken); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs index 55f8b414fcc31..f4e7b1dea31c4 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/GeneratedCodeRecognition/IGeneratedCodeRecognitionService.cs @@ -17,7 +17,5 @@ internal interface IGeneratedCodeRecognitionService : ILanguageService #endif Task IsGeneratedCodeAsync(Document document, CancellationToken cancellationToken); - - bool IsGeneratedCode(SyntaxTree syntaxTree, Document document, CancellationToken cancellationToken); } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems index 90960257abe40..6d798ec06c87a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensions.projitems @@ -10,55 +10,8 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -86,7 +39,6 @@ - diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx index 2bf8009eed9e8..f5b438da33afe 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/WorkspaceExtensionsResources.resx @@ -144,37 +144,4 @@ Warning: Declaration changes scope and may change meaning. - - Location must be null or from source. - - - Could not find location to generation symbol into. - - - Destination location was from a different tree. - - - Destination location was not in source. - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - Destination type must be a {0}, but given one is {1}. - - - Destination type must be a {0} or a {1}, but given one is {2}. - - - No location provided to add statements to. - - - Invalid number of parameters for binary operator. - - - Invalid number of parameters for unary operator. - \ No newline at end of file diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf index 15ce5cde54f35..b260a21696b04 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.cs.xlf @@ -7,41 +7,6 @@ K provedení úlohy se vyžaduje kompilace, ale projekt {0} ji nepodporuje. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Opravit vše ({0}) @@ -57,26 +22,6 @@ Opravit vše ({0}) v řešení - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Ke splnění úkolu se vyžaduje projekt s ID {0}, který ale není z řešení dostupný. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf index f3318f32fe58b..e1b4b7ed01fc5 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.de.xlf @@ -7,41 +7,6 @@ Die Kompilierung ist zum Ausführen der Aufgabe erforderlich, wird aber vom Projekt "{0}" nicht unterstützt. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Alle '{0}' reparieren @@ -57,26 +22,6 @@ Alle '{0}' in Lösung reparieren - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Ein Projekt mit der ID "{0}" ist zum Ausführen der Aufgabe erforderlich, steht aber in der Projektmappe nicht zur Verfügung. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf index 10e0c0bdeed4e..1b78e6d680b8a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.es.xlf @@ -7,41 +7,6 @@ La compilación es necesaria para realizar la tarea, pero el proyecto {0} no la admite. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Corregir todo '{0}' @@ -57,26 +22,6 @@ Corregir todo '{0}' en solución - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Se necesita el identificador de proyecto "{0}" para realizar la tarea, pero no está disponibles en la solución diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf index 00f6c594cbafb..c00a9f0c92b08 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.fr.xlf @@ -7,41 +7,6 @@ Une compilation est nécessaire pour accomplir la tâche, mais elle n'est pas prise en charge par le projet {0}. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Corriger tous les '{0}' @@ -57,26 +22,6 @@ Corriger tous les '{0}' dans la solution - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Le projet de l'ID {0} est nécessaire pour accomplir la tâche mais n'est pas disponible dans la solution diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf index 5324bd365f72f..584ccef5f4fb7 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.it.xlf @@ -7,41 +7,6 @@ Per eseguire l'attività, è necessaria la compilazione, che però non è supportata dal progetto {0}. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Correggi tutti '{0}' @@ -57,26 +22,6 @@ Correggi tutti '{0}' nella soluzione - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Per eseguire l'attività, è necessario il progetto con ID '{0}', che però non è disponibile dalla soluzione diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf index 770f670759bfd..878a0817f7cb4 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ja.xlf @@ -7,41 +7,6 @@ コンパイルはタスクの実行に必要ですが、プロジェクト {0} ではサポートされていません。 - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' すべての '{0}' を修正します @@ -57,26 +22,6 @@ ソリューションに含まれているすべての '{0}' を修正します - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution タスクの完了には ID {0} のプロジェクトが必要ですが、このソリューションからは利用できません diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf index 0b9a670077886..b7893a187a979 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ko.xlf @@ -7,41 +7,6 @@ 작업을 수행하는 데 컴파일이 필요하지만 프로젝트 {0}에서 지원하지 않습니다. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' 모든 '{0}' 수정 @@ -57,26 +22,6 @@ 솔루션의 모든 '{0}' 수정 - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution 작업을 수행하는 데 ID가 {0}인 프로젝트가 필요하지만, 솔루션에서 해당 프로젝트를 사용할 수 없습니다. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf index 0169ce14061b0..6ce41179340ce 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pl.xlf @@ -7,41 +7,6 @@ Ukończenie zadania wymaga kompilacji, ale nie jest ona obsługiwana przez projekt {0}. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Napraw wszystkie wystąpienia elementu „{0}” @@ -57,26 +22,6 @@ Napraw wszystkie wystąpienia elementu „{0}” w rozwiązaniu - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Do wykonania zadania wymagany jest projekt o identyfikatorze {0}, ale nie jest on udostępniany przez rozwiązanie diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf index d5184729cebc9..d9f762bf4227e 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.pt-BR.xlf @@ -7,41 +7,6 @@ A compilação é necessária para realizar a tarefa, mas não é compatível com o projeto {0}. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Corrigir todos os '{0}' @@ -57,26 +22,6 @@ Corrigir todos os '{0}' na Solução - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution O projeto com a ID {0} é necessário para realizar a tarefa, mas não está disponível na solução diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf index 36f75411bc17a..742117c1c9930 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.ru.xlf @@ -7,41 +7,6 @@ Для выполнения задачи требуется компиляция, но она не поддерживается в проекте {0}. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Исправить все "{0}" @@ -57,26 +22,6 @@ Исправить все "{0}" в решении - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Проект с ИД "{0}" необходим для выполнения задачи, но он недоступен из решения. diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf index 92f78344b59f8..befe4cda1ace2 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.tr.xlf @@ -7,41 +7,6 @@ Görevi gerçekleştirmek için derleme gerekiyor ancak bu, {0} projesi tarafından desteklenmiyor. - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' Geçtiği her yerde '{0}' ifadesini düzelt @@ -57,26 +22,6 @@ Çözüm'de geçtiği her yerde '{0}' ifadesini düzelt - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution Görevi gerçekleştirmek için '{0}' kimlikli proje gerekli, ancak bu proje çözümde yok diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf index 2ccebe3aa24ec..6196afb3309a9 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hans.xlf @@ -7,41 +7,6 @@ 必须进行编译才能完成该任务,但项目 {0} 不支持此操作。 - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' 修复所有“{0}” @@ -57,26 +22,6 @@ 修复解决方案中的所有“{0}” - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution 需要 ID 为 {0} 的项目才能完成任务,但无法从解决方案中使用该项目 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf index c1e9af3667f5a..726bc7c6fa2ab 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/xlf/WorkspaceExtensionsResources.zh-Hant.xlf @@ -7,41 +7,6 @@ 必須編譯才能完成工作,但專案 {0} 並不支援。 - - Could not find location to generation symbol into. - Could not find location to generation symbol into. - - - - Destination location was from a different tree. - Destination location was from a different tree. - - - - Destination location was not in source. - Destination location was not in source. - - - - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - Destination type must be a {0}, {1}, {2} or {3}, but given one is {4}. - - - - Destination type must be a {0}, {1} or {2}, but given one is {3}. - Destination type must be a {0}, {1} or {2}, but given one is {3}. - - - - Destination type must be a {0}, but given one is {1}. - Destination type must be a {0}, but given one is {1}. - - - - Destination type must be a {0} or a {1}, but given one is {2}. - Destination type must be a {0} or a {1}, but given one is {2}. - - Fix all '{0}' 修正所有 '{0}' @@ -57,26 +22,6 @@ 修正方案中的所有 '{0}' - - Invalid number of parameters for binary operator. - Invalid number of parameters for binary operator. - - - - Invalid number of parameters for unary operator. - Invalid number of parameters for unary operator. - - - - Location must be null or from source. - Location must be null or from source. - - - - No location provided to add statements to. - No location provided to add statements to. - - Project of ID {0} is required to accomplish the task but is not available from the solution 完成工作需要識別碼為 {0} 的專案,但是無法從解決方案取得 diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb index 88842d65e6cf6..035f8718aa952 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb @@ -12,12 +12,6 @@ Imports Microsoft.CodeAnalysis.PooledObjects Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.VisualBasic.Utilities -#If CODE_STYLE Then -Imports OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions -#Else -Imports Microsoft.CodeAnalysis.Options -#End If - Namespace Microsoft.CodeAnalysis.VisualBasic.AddImports Friend Class VisualBasicAddImportsService @@ -63,11 +57,12 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddImports FirstOrDefault()?.Alias End Function - Public Overrides Function PlaceImportsInsideNamespaces(optionSet As OptionSet) As Boolean +#If Not CODE_STYLE Then + Public Overrides Function PlaceImportsInsideNamespaces(optionSet As Options.OptionSet) As Boolean ' Visual Basic doesn't support imports inside namespaces Return False End Function - +#End If Protected Overrides Function IsStaticUsing(usingOrAlias As ImportsStatementSyntax) As Boolean ' Visual Basic doesn't support static imports Return False From 9a7897a286c41145880f3eff9fbfd79529c29774 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Sat, 2 Apr 2022 16:16:16 +0200 Subject: [PATCH 3/6] Fix errors and remove a hard CodeFixProvider back to Features --- .../CSharpUseLocalFunctionCodeFixProvider.cs | 5 ---- .../Shared/Extensions/IListExtensions.cs | 29 ------------------- .../Extensions/IMethodSymbolExtensions.cs | 21 -------------- .../Shared/Extensions/SourceTextExtensions.cs | 18 ------------ .../Extensions/IMethodSymbolExtensions.cs | 23 +++++++++++++++ .../Core/Extensions/ListExtensions.cs | 16 ++++++++++ ...ourceTextExtensions_SharedWithCodeStyle.cs | 19 ++++++++++++ .../CSharpAddImportsService.cs | 10 +++++-- .../AddImports/AbstractAddImportsService.cs | 10 +++++-- .../AddImports/IAddImportsService.cs | 23 ++++++++++++--- .../VisualBasicAddImportsService.vb | 10 +++++-- 11 files changed, 98 insertions(+), 86 deletions(-) rename src/{Analyzers/CSharp/CodeFixes => Features/CSharp/Portable}/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs (99%) delete mode 100644 src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs diff --git a/src/Analyzers/CSharp/CodeFixes/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs b/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs similarity index 99% rename from src/Analyzers/CSharp/CodeFixes/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs rename to src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs index 87cafd3879c74..19dbb99b310eb 100644 --- a/src/Analyzers/CSharp/CodeFixes/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs +++ b/src/Features/CSharp/Portable/UseLocalFunction/CSharpUseLocalFunctionCodeFixProvider.cs @@ -89,12 +89,7 @@ protected override async Task FixAllAsync( var root = editor.OriginalRoot; var currentRoot = root.TrackNodes(nodesToTrack); -#if CODE_STYLE - var options = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(root.SyntaxTree, cancellationToken); -#else var options = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); -#endif - var languageVersion = semanticModel.SyntaxTree.Options.LanguageVersion(); var makeStaticIfPossible = languageVersion >= LanguageVersion.CSharp8 && options.GetOption(CSharpCodeStyleOptions.PreferStaticLocalFunction).Value; diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs deleted file mode 100644 index e69f2ba59a96f..0000000000000 --- a/src/Workspaces/Core/Portable/Shared/Extensions/IListExtensions.cs +++ /dev/null @@ -1,29 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System; -using System.Collections.Generic; -using Roslyn.Utilities; - -namespace Microsoft.CodeAnalysis.Shared.Extensions -{ - internal static class IListExtensions - { - public static int IndexOf(this IList list, Func predicate) - { - Contract.ThrowIfNull(list); - Contract.ThrowIfNull(predicate); - - for (var i = 0; i < list.Count; i++) - { - if (predicate(list[i])) - { - return i; - } - } - - return -1; - } - } -} diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs index 816b43f8e4ad7..dfd06aa29ec10 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/IMethodSymbolExtensions.cs @@ -55,27 +55,6 @@ public static bool CompatibleSignatureToDelegate(this IMethodSymbol method, INam return true; } - /// - /// Returns the methodSymbol and any partial parts. - /// - public static ImmutableArray GetAllMethodSymbolsOfPartialParts(this IMethodSymbol method) - { - if (method.PartialDefinitionPart != null) - { - Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); - return ImmutableArray.Create(method, method.PartialDefinitionPart); - } - else if (method.PartialImplementationPart != null) - { - Debug.Assert(!Equals(method.PartialImplementationPart, method)); - return ImmutableArray.Create(method.PartialImplementationPart, method); - } - else - { - return ImmutableArray.Create(method); - } - } - public static IMethodSymbol RenameTypeParameters(this IMethodSymbol method, ImmutableArray newNames) { if (method.TypeParameters.Select(t => t.Name).SequenceEqual(newNames)) diff --git a/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs b/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs index 1ceb1db50bb73..84e5de00012ef 100644 --- a/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs +++ b/src/Workspaces/Core/Portable/Shared/Extensions/SourceTextExtensions.cs @@ -16,24 +16,6 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class SourceTextExtensions { - /// - /// Returns the leading whitespace of the line located at the specified position in the given snapshot. - /// - public static string GetLeadingWhitespaceOfLineAtPosition(this SourceText text, int position) - { - Contract.ThrowIfNull(text); - - var line = text.Lines.GetLineFromPosition(position); - var linePosition = line.GetFirstNonWhitespacePosition(); - if (!linePosition.HasValue) - { - return line.ToString(); - } - - var lineText = line.ToString(); - return lineText.Substring(0, linePosition.Value - line.Start); - } - public static void GetLineAndOffset(this SourceText text, int position, out int lineNumber, out int offset) { var line = text.Lines.GetLineFromPosition(position); diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs index 34d3c61dd7f1a..923f603901323 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/IMethodSymbolExtensions.cs @@ -3,6 +3,8 @@ // See the LICENSE file in the project root for more information. using System; +using System.Collections.Immutable; +using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using Microsoft.CodeAnalysis.LanguageServices; @@ -10,6 +12,27 @@ namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class IMethodSymbolExtensions { + /// + /// Returns the methodSymbol and any partial parts. + /// + public static ImmutableArray GetAllMethodSymbolsOfPartialParts(this IMethodSymbol method) + { + if (method.PartialDefinitionPart != null) + { + Debug.Assert(method.PartialImplementationPart == null && !Equals(method.PartialDefinitionPart, method)); + return ImmutableArray.Create(method, method.PartialDefinitionPart); + } + else if (method.PartialImplementationPart != null) + { + Debug.Assert(!Equals(method.PartialImplementationPart, method)); + return ImmutableArray.Create(method.PartialImplementationPart, method); + } + else + { + return ImmutableArray.Create(method); + } + } + /// /// Returns true for void returning methods with two parameters, where /// the first parameter is of type and the second diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs index 0a3dd965b3f54..b9695d23e8e1a 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/ListExtensions.cs @@ -62,5 +62,21 @@ public static bool TryRemoveFirst(this IList list, Func(this IList list, Func predicate) + { + Contract.ThrowIfNull(list); + Contract.ThrowIfNull(predicate); + + for (var i = 0; i < list.Count; i++) + { + if (predicate(list[i])) + { + return i; + } + } + + return -1; + } } } diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs index 6f39379e5a29e..89325f2535625 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Compiler/Core/Extensions/SourceTextExtensions_SharedWithCodeStyle.cs @@ -5,11 +5,30 @@ using System; using System.Threading; using Microsoft.CodeAnalysis.Text; +using Roslyn.Utilities; namespace Microsoft.CodeAnalysis.Shared.Extensions { internal static partial class SourceTextExtensions { + /// + /// Returns the leading whitespace of the line located at the specified position in the given snapshot. + /// + public static string GetLeadingWhitespaceOfLineAtPosition(this SourceText text, int position) + { + Contract.ThrowIfNull(text); + + var line = text.Lines.GetLineFromPosition(position); + var linePosition = line.GetFirstNonWhitespacePosition(); + if (!linePosition.HasValue) + { + return line.ToString(); + } + + var lineText = line.ToString(); + return lineText.Substring(0, linePosition.Value - line.Start); + } + public static bool OverlapsHiddenPosition( this SourceText text, TextSpan span, Func isPositionHidden, CancellationToken cancellationToken) { diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs index 1b726becb9d2b..600befdf1ba0c 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/CSharp/LanguageServices/CSharpAddImportsService.cs @@ -15,6 +15,12 @@ using Microsoft.CodeAnalysis.Host.Mef; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + namespace Microsoft.CodeAnalysis.CSharp.AddImport { [ExportLanguageService(typeof(IAddImportsService), LanguageNames.CSharp), Shared] @@ -27,12 +33,10 @@ public CSharpAddImportsService() { } -#if !CODE_STYLE - public override bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet) + public override bool PlaceImportsInsideNamespaces(OptionSet optionSet) { return optionSet.GetOption(CSharpCodeStyleOptions.PreferredUsingDirectivePlacement).Value == AddImportPlacement.InsideNamespace; } -#endif // C# doesn't have global imports. protected override ImmutableArray GetGlobalImports(Compilation compilation, SyntaxGenerator generator) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs index 68eac08935bf7..04763463f1f96 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/AbstractAddImportsService.cs @@ -10,6 +10,12 @@ using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Shared.Extensions; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + namespace Microsoft.CodeAnalysis.AddImport { internal abstract class AbstractAddImportsService @@ -29,9 +35,7 @@ protected AbstractAddImportsService() protected abstract SyntaxList GetExterns(SyntaxNode node); protected abstract bool IsStaticUsing(TUsingOrAliasSyntax usingOrAlias); -#if !CODE_STYLE - public abstract bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet); -#endif + public abstract bool PlaceImportsInsideNamespaces(OptionSet optionSet); private bool IsSimpleUsing(TUsingOrAliasSyntax usingOrAlias) => !IsAlias(usingOrAlias) && !IsStaticUsing(usingOrAlias); private bool IsAlias(TUsingOrAliasSyntax usingOrAlias) => GetAlias(usingOrAlias) != null; diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs index 489d167099e4b..e29753b2de1ba 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs @@ -6,11 +6,18 @@ using System.Runtime.Serialization; using System.Threading; using System.Threading.Tasks; +using Microsoft.CodeAnalysis.Diagnostics; using Microsoft.CodeAnalysis.Editing; using Microsoft.CodeAnalysis.Host; using Microsoft.CodeAnalysis.Shared.Extensions; using Roslyn.Utilities; +#if CODE_STYLE +using OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions; +#else +using OptionSet = Microsoft.CodeAnalysis.Options.OptionSet; +#endif + namespace Microsoft.CodeAnalysis.AddImport { [DataContract] @@ -23,7 +30,7 @@ internal record struct AddImportPlacementOptions( public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) => FromDocument(document, await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false)); - public static AddImportPlacementOptions FromDocument(Document document, Options.OptionSet documentOptions) + public static AddImportPlacementOptions FromDocument(Document document, OptionSet documentOptions) { var service = document.GetRequiredLanguageService(); @@ -41,14 +48,22 @@ private static bool CanAddImportsInHiddenRegions(Document document) var spanMapper = document.Services.GetService(); return spanMapper != null && spanMapper.SupportsMappingImportDirectives; } +#else + public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) + { + var service = document.GetRequiredLanguageService(); + var options = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false), cancellationToken); + return new( + PlaceSystemNamespaceFirst: options.GetOption(GenerationOptions.PlaceSystemNamespaceFirst), + PlaceImportsInsideNamespaces: service.PlaceImportsInsideNamespaces(options), + AllowInHiddenRegions: false); + } #endif } internal interface IAddImportsService : ILanguageService { -#if !CODE_STYLE - bool PlaceImportsInsideNamespaces(Options.OptionSet optionSet); -#endif + bool PlaceImportsInsideNamespaces(OptionSet optionSet); /// /// Returns true if the tree already has an existing import syntactically equivalent to diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb index 035f8718aa952..2adb2a6de2df5 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/VisualBasic/LanguageServices/VisualBasicAddImportsService.vb @@ -12,6 +12,12 @@ Imports Microsoft.CodeAnalysis.PooledObjects Imports Microsoft.CodeAnalysis.VisualBasic.Syntax Imports Microsoft.CodeAnalysis.VisualBasic.Utilities +#If CODE_STYLE Then +Imports OptionSet = Microsoft.CodeAnalysis.Diagnostics.AnalyzerConfigOptions +#Else +Imports OptionSet = Microsoft.CodeAnalysis.Options.OptionSet +#End If + Namespace Microsoft.CodeAnalysis.VisualBasic.AddImports Friend Class VisualBasicAddImportsService @@ -57,12 +63,10 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.AddImports FirstOrDefault()?.Alias End Function -#If Not CODE_STYLE Then - Public Overrides Function PlaceImportsInsideNamespaces(optionSet As Options.OptionSet) As Boolean + Public Overrides Function PlaceImportsInsideNamespaces(optionSet As OptionSet) As Boolean ' Visual Basic doesn't support imports inside namespaces Return False End Function -#End If Protected Overrides Function IsStaticUsing(usingOrAlias As ImportsStatementSyntax) As Boolean ' Visual Basic doesn't support static imports Return False From f82a7a10809ccf78fffca368eed3df8d389ee064 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Sat, 2 Apr 2022 16:23:26 +0200 Subject: [PATCH 4/6] Update projitems --- src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems | 1 - 1 file changed, 1 deletion(-) diff --git a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems index f0c1f8f9d08b0..aa691a6e730a6 100644 --- a/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems +++ b/src/Analyzers/CSharp/CodeFixes/CSharpCodeFixes.projitems @@ -39,7 +39,6 @@ - From baa1cd7831a7ac5e807042340b4ca3a6865083d8 Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Sat, 2 Apr 2022 17:14:19 +0200 Subject: [PATCH 5/6] Move tests --- .../Tests}/AddInheritdoc/AddInheritdocTests.cs | 0 .../AddObsoleteAttributeTests.cs | 0 .../AliasAmbiguousType/AliasAmbiguousTypeTests.cs | 0 .../Tests/CSharpAnalyzers.UnitTests.projitems | 14 ++++++++++++++ .../DisambiguateSameVariableTests.cs | 0 .../Tests}/FixReturnType/FixReturnTypeTests.cs | 0 .../CSharp/Tests}/HideBase/HideBaseTests.cs | 0 .../CSharp/Tests}/Iterator/AddYieldTests.cs | 0 .../Tests}/Iterator/ChangeToIEnumerableTests.cs | 0 .../MakeMemberStatic/MakeMemberStaticTests.cs | 0 .../CSharpMakeStatementAsynchronousCodeFixTests.cs | 0 .../MakeTypeAbstract/MakeTypeAbstractTests.cs | 0 .../CSharpDeclareAsNullableCodeFixTests.cs | 0 .../CSharp/Tests}/UnsealClass/UnsealClassTests.cs | 0 .../UseInterpolatedVerbatimStringCodeFixTests.cs | 0 .../AddObsoleteAttributeTests.vb | 0 .../AliasAmbiguousType/AliasAmbiguousTypeTests.vb | 0 .../VisualBasic/Tests}/Iterator/IteratorTests.vb | 0 .../MakeTypeAbstract/MakeTypeAbstractTests.vb | 0 .../Tests}/UnsealClass/UnsealClassTests.vb | 0 .../Tests/VisualBasicAnalyzers.UnitTests.projitems | 5 +++++ 21 files changed, 19 insertions(+) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/AddInheritdoc/AddInheritdocTests.cs (100%) rename src/{EditorFeatures/CSharpTest => Analyzers/CSharp/Tests}/AddObsoleteAttribute/AddObsoleteAttributeTests.cs (100%) rename src/{EditorFeatures/CSharpTest => Analyzers/CSharp/Tests}/AliasAmbiguousType/AliasAmbiguousTypeTests.cs (100%) rename src/{EditorFeatures/CSharpTest => Analyzers/CSharp/Tests}/DisambiguateSameVariable/DisambiguateSameVariableTests.cs (100%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/FixReturnType/FixReturnTypeTests.cs (100%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/HideBase/HideBaseTests.cs (100%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/Iterator/AddYieldTests.cs (100%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/Iterator/ChangeToIEnumerableTests.cs (100%) rename src/{EditorFeatures/CSharpTest => Analyzers/CSharp/Tests}/MakeMemberStatic/MakeMemberStaticTests.cs (100%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixTests.cs (100%) rename src/{EditorFeatures/CSharpTest => Analyzers/CSharp/Tests}/MakeTypeAbstract/MakeTypeAbstractTests.cs (100%) rename src/{EditorFeatures/CSharpTest/Diagnostics => Analyzers/CSharp/Tests}/Nullable/CSharpDeclareAsNullableCodeFixTests.cs (100%) rename src/{EditorFeatures/CSharpTest => Analyzers/CSharp/Tests}/UnsealClass/UnsealClassTests.cs (100%) rename src/{EditorFeatures/CSharpTest => Analyzers/CSharp/Tests}/UseInterpolatedVerbatimString/UseInterpolatedVerbatimStringCodeFixTests.cs (100%) rename src/{EditorFeatures/VisualBasicTest => Analyzers/VisualBasic/Tests}/AddObsoleteAttribute/AddObsoleteAttributeTests.vb (100%) rename src/{EditorFeatures/VisualBasicTest/Diagnostics => Analyzers/VisualBasic/Tests}/AliasAmbiguousType/AliasAmbiguousTypeTests.vb (100%) rename src/{EditorFeatures/VisualBasicTest/Diagnostics => Analyzers/VisualBasic/Tests}/Iterator/IteratorTests.vb (100%) rename src/{EditorFeatures/VisualBasicTest => Analyzers/VisualBasic/Tests}/MakeTypeAbstract/MakeTypeAbstractTests.vb (100%) rename src/{EditorFeatures/VisualBasicTest => Analyzers/VisualBasic/Tests}/UnsealClass/UnsealClassTests.vb (100%) diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/AddInheritdoc/AddInheritdocTests.cs b/src/Analyzers/CSharp/Tests/AddInheritdoc/AddInheritdocTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/AddInheritdoc/AddInheritdocTests.cs rename to src/Analyzers/CSharp/Tests/AddInheritdoc/AddInheritdocTests.cs diff --git a/src/EditorFeatures/CSharpTest/AddObsoleteAttribute/AddObsoleteAttributeTests.cs b/src/Analyzers/CSharp/Tests/AddObsoleteAttribute/AddObsoleteAttributeTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/AddObsoleteAttribute/AddObsoleteAttributeTests.cs rename to src/Analyzers/CSharp/Tests/AddObsoleteAttribute/AddObsoleteAttributeTests.cs diff --git a/src/EditorFeatures/CSharpTest/AliasAmbiguousType/AliasAmbiguousTypeTests.cs b/src/Analyzers/CSharp/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/AliasAmbiguousType/AliasAmbiguousTypeTests.cs rename to src/Analyzers/CSharp/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.cs diff --git a/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems b/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems index b40c50a32715d..607c96a22ed55 100644 --- a/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems +++ b/src/Analyzers/CSharp/Tests/CSharpAnalyzers.UnitTests.projitems @@ -11,11 +11,23 @@ + + + + + + + + + + + + @@ -40,6 +52,7 @@ + @@ -89,6 +102,7 @@ + diff --git a/src/EditorFeatures/CSharpTest/DisambiguateSameVariable/DisambiguateSameVariableTests.cs b/src/Analyzers/CSharp/Tests/DisambiguateSameVariable/DisambiguateSameVariableTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/DisambiguateSameVariable/DisambiguateSameVariableTests.cs rename to src/Analyzers/CSharp/Tests/DisambiguateSameVariable/DisambiguateSameVariableTests.cs diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/FixReturnType/FixReturnTypeTests.cs b/src/Analyzers/CSharp/Tests/FixReturnType/FixReturnTypeTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/FixReturnType/FixReturnTypeTests.cs rename to src/Analyzers/CSharp/Tests/FixReturnType/FixReturnTypeTests.cs diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/HideBase/HideBaseTests.cs b/src/Analyzers/CSharp/Tests/HideBase/HideBaseTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/HideBase/HideBaseTests.cs rename to src/Analyzers/CSharp/Tests/HideBase/HideBaseTests.cs diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/Iterator/AddYieldTests.cs b/src/Analyzers/CSharp/Tests/Iterator/AddYieldTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/Iterator/AddYieldTests.cs rename to src/Analyzers/CSharp/Tests/Iterator/AddYieldTests.cs diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/Iterator/ChangeToIEnumerableTests.cs b/src/Analyzers/CSharp/Tests/Iterator/ChangeToIEnumerableTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/Iterator/ChangeToIEnumerableTests.cs rename to src/Analyzers/CSharp/Tests/Iterator/ChangeToIEnumerableTests.cs diff --git a/src/EditorFeatures/CSharpTest/MakeMemberStatic/MakeMemberStaticTests.cs b/src/Analyzers/CSharp/Tests/MakeMemberStatic/MakeMemberStaticTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/MakeMemberStatic/MakeMemberStaticTests.cs rename to src/Analyzers/CSharp/Tests/MakeMemberStatic/MakeMemberStaticTests.cs diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixTests.cs b/src/Analyzers/CSharp/Tests/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixTests.cs rename to src/Analyzers/CSharp/Tests/MakeStatementAsynchronous/CSharpMakeStatementAsynchronousCodeFixTests.cs diff --git a/src/EditorFeatures/CSharpTest/MakeTypeAbstract/MakeTypeAbstractTests.cs b/src/Analyzers/CSharp/Tests/MakeTypeAbstract/MakeTypeAbstractTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/MakeTypeAbstract/MakeTypeAbstractTests.cs rename to src/Analyzers/CSharp/Tests/MakeTypeAbstract/MakeTypeAbstractTests.cs diff --git a/src/EditorFeatures/CSharpTest/Diagnostics/Nullable/CSharpDeclareAsNullableCodeFixTests.cs b/src/Analyzers/CSharp/Tests/Nullable/CSharpDeclareAsNullableCodeFixTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/Diagnostics/Nullable/CSharpDeclareAsNullableCodeFixTests.cs rename to src/Analyzers/CSharp/Tests/Nullable/CSharpDeclareAsNullableCodeFixTests.cs diff --git a/src/EditorFeatures/CSharpTest/UnsealClass/UnsealClassTests.cs b/src/Analyzers/CSharp/Tests/UnsealClass/UnsealClassTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/UnsealClass/UnsealClassTests.cs rename to src/Analyzers/CSharp/Tests/UnsealClass/UnsealClassTests.cs diff --git a/src/EditorFeatures/CSharpTest/UseInterpolatedVerbatimString/UseInterpolatedVerbatimStringCodeFixTests.cs b/src/Analyzers/CSharp/Tests/UseInterpolatedVerbatimString/UseInterpolatedVerbatimStringCodeFixTests.cs similarity index 100% rename from src/EditorFeatures/CSharpTest/UseInterpolatedVerbatimString/UseInterpolatedVerbatimStringCodeFixTests.cs rename to src/Analyzers/CSharp/Tests/UseInterpolatedVerbatimString/UseInterpolatedVerbatimStringCodeFixTests.cs diff --git a/src/EditorFeatures/VisualBasicTest/AddObsoleteAttribute/AddObsoleteAttributeTests.vb b/src/Analyzers/VisualBasic/Tests/AddObsoleteAttribute/AddObsoleteAttributeTests.vb similarity index 100% rename from src/EditorFeatures/VisualBasicTest/AddObsoleteAttribute/AddObsoleteAttributeTests.vb rename to src/Analyzers/VisualBasic/Tests/AddObsoleteAttribute/AddObsoleteAttributeTests.vb diff --git a/src/EditorFeatures/VisualBasicTest/Diagnostics/AliasAmbiguousType/AliasAmbiguousTypeTests.vb b/src/Analyzers/VisualBasic/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.vb similarity index 100% rename from src/EditorFeatures/VisualBasicTest/Diagnostics/AliasAmbiguousType/AliasAmbiguousTypeTests.vb rename to src/Analyzers/VisualBasic/Tests/AliasAmbiguousType/AliasAmbiguousTypeTests.vb diff --git a/src/EditorFeatures/VisualBasicTest/Diagnostics/Iterator/IteratorTests.vb b/src/Analyzers/VisualBasic/Tests/Iterator/IteratorTests.vb similarity index 100% rename from src/EditorFeatures/VisualBasicTest/Diagnostics/Iterator/IteratorTests.vb rename to src/Analyzers/VisualBasic/Tests/Iterator/IteratorTests.vb diff --git a/src/EditorFeatures/VisualBasicTest/MakeTypeAbstract/MakeTypeAbstractTests.vb b/src/Analyzers/VisualBasic/Tests/MakeTypeAbstract/MakeTypeAbstractTests.vb similarity index 100% rename from src/EditorFeatures/VisualBasicTest/MakeTypeAbstract/MakeTypeAbstractTests.vb rename to src/Analyzers/VisualBasic/Tests/MakeTypeAbstract/MakeTypeAbstractTests.vb diff --git a/src/EditorFeatures/VisualBasicTest/UnsealClass/UnsealClassTests.vb b/src/Analyzers/VisualBasic/Tests/UnsealClass/UnsealClassTests.vb similarity index 100% rename from src/EditorFeatures/VisualBasicTest/UnsealClass/UnsealClassTests.vb rename to src/Analyzers/VisualBasic/Tests/UnsealClass/UnsealClassTests.vb diff --git a/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems b/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems index 9d44e1576f130..e913d80783866 100644 --- a/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems +++ b/src/Analyzers/VisualBasic/Tests/VisualBasicAnalyzers.UnitTests.projitems @@ -12,13 +12,18 @@ + + + + + From ca0c17c6c5d317cb16941f44242fe9cb604950ae Mon Sep 17 00:00:00 2001 From: Youssef1313 Date: Mon, 4 Apr 2022 09:38:10 +0200 Subject: [PATCH 6/6] Address review comment --- .../AddImports/IAddImportsService.cs | 32 +++++++++---------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs index e29753b2de1ba..3929b0465ec9f 100644 --- a/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs +++ b/src/Workspaces/SharedUtilitiesAndExtensions/Workspace/Core/LanguageServices/AddImports/IAddImportsService.cs @@ -26,39 +26,37 @@ internal record struct AddImportPlacementOptions( [property: DataMember(Order = 1)] bool PlaceImportsInsideNamespaces, [property: DataMember(Order = 2)] bool AllowInHiddenRegions) { -#if !CODE_STYLE public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) - => FromDocument(document, await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false)); - - public static AddImportPlacementOptions FromDocument(Document document, OptionSet documentOptions) { - var service = document.GetRequiredLanguageService(); - - return new( - PlaceSystemNamespaceFirst: documentOptions.GetOption(GenerationOptions.PlaceSystemNamespaceFirst, document.Project.Language), - PlaceImportsInsideNamespaces: service.PlaceImportsInsideNamespaces(documentOptions), - AllowInHiddenRegions: CanAddImportsInHiddenRegions(document)); +#if CODE_STYLE + var options = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false), cancellationToken); +#else + var options = await document.GetOptionsAsync(cancellationToken).ConfigureAwait(false); +#endif + return FromDocument(document, options); } private static bool CanAddImportsInHiddenRegions(Document document) { +#if CODE_STYLE + return false; +#else // Normally we don't allow generation into a hidden region in the file. However, if we have a // modern span mapper at our disposal, we do allow it as that host span mapper can handle mapping // our edit to their domain appropriate. var spanMapper = document.Services.GetService(); return spanMapper != null && spanMapper.SupportsMappingImportDirectives; +#endif } -#else - public static async Task FromDocumentAsync(Document document, CancellationToken cancellationToken) + + public static AddImportPlacementOptions FromDocument(Document document, OptionSet documentOptions) { var service = document.GetRequiredLanguageService(); - var options = document.Project.AnalyzerOptions.GetAnalyzerOptionSet(await document.GetRequiredSyntaxTreeAsync(cancellationToken).ConfigureAwait(false), cancellationToken); return new( - PlaceSystemNamespaceFirst: options.GetOption(GenerationOptions.PlaceSystemNamespaceFirst), - PlaceImportsInsideNamespaces: service.PlaceImportsInsideNamespaces(options), - AllowInHiddenRegions: false); + PlaceSystemNamespaceFirst: documentOptions.GetOption(GenerationOptions.PlaceSystemNamespaceFirst, document.Project.Language), + PlaceImportsInsideNamespaces: service.PlaceImportsInsideNamespaces(documentOptions), + AllowInHiddenRegions: CanAddImportsInHiddenRegions(document)); } -#endif } internal interface IAddImportsService : ILanguageService