提交 7d8a6922 编写于 作者: D David Poeschl

Merge cleanup

上级 2ad5c70c
......@@ -14,6 +14,7 @@
using Microsoft.CodeAnalysis.ChangeSignature;
using Microsoft.CodeAnalysis.CSharp.CodeGeneration;
using Microsoft.CodeAnalysis.CSharp.Extensions;
using Microsoft.CodeAnalysis.CSharp.LanguageServices;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using Microsoft.CodeAnalysis.Editing;
using Microsoft.CodeAnalysis.FindSymbols;
......@@ -32,7 +33,7 @@ namespace Microsoft.CodeAnalysis.CSharp.ChangeSignature
internal sealed class CSharpChangeSignatureService : AbstractChangeSignatureService
{
protected override SyntaxGenerator Generator => CSharpSyntaxGenerator.Instance;
protected override ISyntaxFactsService SyntaxFacts => CSharpSyntaxFactsService.Instance;
protected override ISyntaxFacts SyntaxFacts => CSharpSyntaxFacts.Instance;
private static readonly ImmutableArray<SyntaxKind> _declarationKinds = ImmutableArray.Create(
SyntaxKind.MethodDeclaration,
......@@ -453,13 +454,13 @@ private static ParameterSyntax CreateNewParameterSyntax(AddedParameter addedPara
{
var equalsValueClause = addedParameter.HasDefaultValue
? EqualsValueClause(ParseExpression(addedParameter.DefaultValue))
: default;
: null;
return Parameter(
attributeLists: default,
modifiers: default,
type: skipParameterType
? default
? null
: addedParameter.Type.GenerateTypeSyntax()
.WithTrailingTrivia(ElasticSpace),
Identifier(addedParameter.Name),
......
......@@ -520,7 +520,7 @@ private bool TryGetNodeWithEditableSignatureOrAttributes(Location location, Solu
}
// 5. Add the params argument with the first value:
if (paramsArrayArgument != default)
if (paramsArrayArgument != null)
{
var param = argumentToParameterMap[paramsArrayArgument];
if (seenNamedArgument && !paramsArrayArgument.IsNamed)
......@@ -716,7 +716,7 @@ protected static int GetParameterIndex<TNode>(SeparatedSyntaxList<TNode> paramet
}
protected abstract SyntaxGenerator Generator { get; }
protected abstract ISyntaxFactsService SyntaxFacts { get; }
protected abstract ISyntaxFacts SyntaxFacts { get; }
protected SeparatedSyntaxList<SyntaxNode> AddNewArgumentsToList(
ISymbol declarationSymbol,
......@@ -753,7 +753,7 @@ protected static int GetParameterIndex<TNode>(SeparatedSyntaxList<TNode> paramet
fullList.Add(
Generator.Argument(
name: seenNamedArguments || addedParameter.UseNamedArguments ? addedParameter.Name : default,
name: seenNamedArguments || addedParameter.UseNamedArguments ? addedParameter.Name : null,
refKind: RefKind.None,
expression: Generator.ParseExpression(addedParameter.IsCallsiteError ? "TODO" : addedParameter.CallSiteValue)));
separators.Add(CommaTokenWithElasticSpace());
......
......@@ -25,7 +25,7 @@ public ChangeSignatureCodeAction(AbstractChangeSignatureService changeSignatureS
public override string Title => FeaturesResources.Change_signature;
public override object? GetOptions(CancellationToken cancellationToken)
public override object GetOptions(CancellationToken cancellationToken)
{
return _changeSignatureService.GetChangeSignatureOptions(_context)
?? new ChangeSignatureOptionsResult(null!, false);
......
......@@ -16,6 +16,7 @@ Imports Microsoft.CodeAnalysis.LanguageServices
Imports Microsoft.CodeAnalysis.PooledObjects
Imports Microsoft.CodeAnalysis.Simplification
Imports Microsoft.CodeAnalysis.VisualBasic.CodeGeneration
Imports Microsoft.CodeAnalysis.VisualBasic.LanguageServices
Imports Microsoft.CodeAnalysis.VisualBasic.Syntax
Imports Microsoft.CodeAnalysis.VisualBasic.SyntaxFactory
......@@ -624,9 +625,9 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.ChangeSignature
End Get
End Property
Protected Overrides ReadOnly Property SyntaxFacts As ISyntaxFactsService
Protected Overrides ReadOnly Property SyntaxFacts As ISyntaxFacts
Get
Return VisualBasicSyntaxFactsService.Instance
Return VisualBasicSyntaxFacts.Instance
End Get
End Property
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Klasifikace</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">Dokončila se analýza kódu pro {0}.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Klassifizierungen</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">Die Codeanalyse für "{0}" wurde abgeschlossen.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Clasificaciones</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">El análisis de código se ha completado para "{0}".</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Classifications</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">Analyse du code effectuée pour '{0}'.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Classificazioni</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">Analisi codice completata per '{0}'.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">分類</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">'{0}' のコード分析が完了しました。</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">분류</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">'{0}'에 대한 코드 분석이 완료되었습니다.</target>
......@@ -719,9 +704,9 @@
</trans-unit>
<trans-unit id="Value_to_inject_at_call_sites_colon">
<source>Value to inject at call sites:</source>
<target state="new">Value to inject at call sites:</target>
<note />
</trans-unit>
<target state="new">Value to inject at call sites:</target>
<trans-unit id="Visual_Studio_2017">
<source>Visual Studio 2017</source>
<target state="new">Visual Studio 2017</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Klasyfikacje</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">Ukończono analizę kodu dla elementu „{0}”.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Classificações</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">Análise de código concluída para '{0}'.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Классификации</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">Анализ кода для "{0}" выполнен.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">Sınıflandırmalar</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">'{0}' için kod analizi tamamlandı.</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">分类</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">“{0}”的代码分析已完成。</target>
......
......@@ -112,21 +112,6 @@
<target state="new">Call site</target>
<note />
</trans-unit>
<trans-unit id="Classifications">
<source>Classifications</source>
<target state="translated">分類</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIndicator">
<source>&lt;new&gt;</source>
<target state="new">&lt;new&gt;</target>
<note />
</trans-unit>
<trans-unit id="ChangeSignature_NewParameterIntroduceTODOVariable">
<source>TODO</source>
<target state="new">TODO</target>
<note>"TODO" is an indication that there is work to be done still</note>
</trans-unit>
<trans-unit id="Code_analysis_completed_for_0">
<source>Code analysis completed for '{0}'.</source>
<target state="translated">'{0}' 的程式碼分析已完成。</target>
......
......@@ -1713,7 +1713,7 @@ public void GetPartsOfCastExpression(SyntaxNode node, out SyntaxNode type, out S
}
public override SyntaxList<SyntaxNode> GetAttributeLists(SyntaxNode node)
=> CSharpSyntaxGenerator.GetAttributeLists(node);
=> node.GetAttributeLists();
public override bool IsParameterNameXmlElementSyntax(SyntaxNode node)
=> node.IsKind(SyntaxKind.XmlElement) &&
......
......@@ -434,7 +434,7 @@ internal partial interface ISyntaxFacts
bool IsParameterNameXmlElementSyntax(SyntaxNode node);
SyntaxNode[] GetContentFromDocumentationCommentTriviaSyntax(SyntaxTrivia trivia);
bool CanHaveAccessibility(SyntaxNode declaration);
/// <summary>
......
......@@ -1896,7 +1896,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices
Return False
End Function
Public Overrides Function IsParameterNameXmlElementSyntax(node As SyntaxNode) As Boolean Implements ISyntaxFactsService.IsParameterNameXmlElementSyntax
Public Overrides Function IsParameterNameXmlElementSyntax(node As SyntaxNode) As Boolean Implements ISyntaxFacts.IsParameterNameXmlElementSyntax
Dim xmlElement = TryCast(node, XmlElementSyntax)
If xmlElement IsNot Nothing Then
......@@ -1906,7 +1906,7 @@ Namespace Microsoft.CodeAnalysis.VisualBasic.LanguageServices
Return False
End Function
Public Overrides Function GetContentFromDocumentationCommentTriviaSyntax(trivia As SyntaxTrivia) As SyntaxNode() Implements ISyntaxFactsService.GetContentFromDocumentationCommentTriviaSyntax
Public Overrides Function GetContentFromDocumentationCommentTriviaSyntax(trivia As SyntaxTrivia) As SyntaxNode() Implements ISyntaxFacts.GetContentFromDocumentationCommentTriviaSyntax
Dim documentationCommentTrivia = TryCast(trivia.GetStructure(), DocumentationCommentTriviaSyntax)
If documentationCommentTrivia IsNot Nothing Then
Return documentationCommentTrivia.Content.ToArray()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册