提交 e9e030f1 编写于 作者: G Gen Lu

Fix LOC

上级 612f5c3c
......@@ -1145,6 +1145,48 @@ public void M({type} x)
inlineDescription: expectedNamespace);
}
[InlineData("int")]
[InlineData("Exception")]
[Theory, Trait(Traits.Feature, Traits.Features.Completion)]
public async Task TestIdenticalMethodName(string type)
{
var file1 = @"
using System;
namespace Foo
{
public static class ExtensionClass
{
public static bool ExtMethod(this int x)
=> true;
public static bool ExtMethod(this Exception x)
=> true;
}
}
";
var file2 = $@"
using System;
namespace Baz
{{
public class Bat
{{
public void M({type} x)
{{
x.$$
}}
}}
}}";
var markup = GetMarkup(file2, file1, ReferenceType.None);
await VerifyTypeImportItemExistsAsync(
markup,
"ExtMethod",
glyph: (int)Glyph.ExtensionMethodPublic,
inlineDescription: "Foo");
}
private Task VerifyTypeImportItemExistsAsync(string markup, string expectedItem, int glyph, string inlineDescription, string displayTextSuffix = null, string expectedDescriptionOrNull = null)
{
return VerifyItemExistsAsync(markup, expectedItem, displayTextSuffix: displayTextSuffix, glyph: glyph, inlineDescription: inlineDescription, expectedDescriptionOrNull: expectedDescriptionOrNull);
......
......@@ -21,9 +21,7 @@ internal static class ImportCompletionItem
private const string SymbolKeyData = nameof(SymbolKeyData);
public static CompletionItem Create(INamedTypeSymbol typeSymbol, string containingNamespace, string genericTypeSuffix)
{
return Create(typeSymbol.Name, typeSymbol.Arity, containingNamespace, typeSymbol.GetGlyph(), genericTypeSuffix, CompletionItemFlags.CachedAndExpanded, symbolKeyData: null);
}
=> Create(typeSymbol.Name, typeSymbol.Arity, containingNamespace, typeSymbol.GetGlyph(), genericTypeSuffix, CompletionItemFlags.CachedAndExpanded, symbolKeyData: null);
public static CompletionItem Create(string name, int arity, string containingNamespace, Glyph glyph, string genericTypeSuffix, CompletionItemFlags flags, string? symbolKeyData)
{
......@@ -39,7 +37,8 @@ public static CompletionItem Create(string name, int arity, string containingNam
}
else
{
// We don't need arity to recover symbol if we have SymbolKeyData.
// We don't need arity to recover symbol if we already have SymbolKeyData or it's 0.
// (but it still needed below to decide whether to show generic suffix)
builder.Add(TypeAritySuffixName, AbstractDeclaredSymbolInfoFactoryService.GetMetadataAritySuffix(arity));
}
......@@ -89,9 +88,7 @@ public static CompletionItem CreateAttributeItemWithoutSuffix(CompletionItem att
}
public static CompletionItem CreateItemWithGenericDisplaySuffix(CompletionItem item, string genericTypeSuffix)
{
return item.WithDisplayTextSuffix(genericTypeSuffix);
}
=> item.WithDisplayTextSuffix(genericTypeSuffix);
public static string GetContainingNamespace(CompletionItem item)
=> item.InlineDescription;
......
......@@ -2,7 +2,6 @@
#nullable enable
namespace Microsoft.CodeAnalysis.Completion.Providers
{
internal sealed class SerializableImportCompletionItem
......
......@@ -128,7 +128,7 @@ public static async Task<Compilation> GetRequiredCompilationAsync(this Project p
var compilation = await project.GetCompilationAsync(cancellationToken).ConfigureAwait(false);
if (compilation == null)
{
throw new InvalidOperationException(string.Format(WorkspacesResources.Project_0_does_not_support_compilation, project.Name));
throw new InvalidOperationException(string.Format(WorkspacesResources.Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0, project.Name));
}
return compilation;
......
......@@ -574,6 +574,15 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Compilation is required to accomplish the task but is not supported by project {0}..
/// </summary>
internal static string Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0 {
get {
return ResourceManager.GetString("Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Core EditorConfig Options.
/// </summary>
......@@ -1366,15 +1375,6 @@ internal class WorkspacesResources {
}
}
/// <summary>
/// Looks up a localized string similar to Project {0} does not support compilation..
/// </summary>
internal static string Project_0_does_not_support_compilation {
get {
return ResourceManager.GetString("Project_0_does_not_support_compilation", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Project file not found: &apos;{0}&apos;.
/// </summary>
......
......@@ -1479,7 +1479,7 @@ Zero-width positive lookbehind assertions are typically used at the beginning of
<data name="Document_does_not_support_syntax_trees" xml:space="preserve">
<value>Document does not support syntax trees</value>
</data>
<data name="Project_0_does_not_support_compilation" xml:space="preserve">
<value>Project {0} does not support compilation.</value>
<data name="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0" xml:space="preserve">
<value>Compilation is required to accomplish the task but is not supported by project {0}.</value>
</data>
</root>
\ No newline at end of file
......@@ -27,6 +27,11 @@
<target state="translated">Změna dokumentu {0} není podporovaná.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Základní možnosti pro EditorConfig</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">Das Ändern des Dokuments "{0}" wird nicht unterstützt.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Wichtige EditorConfig-Optionen</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">Documento cambiante '{0}' no es compatible.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Opciones principales de EditorConfig</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">Le changement du document '{0}' n'est pas pris en charge.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Options EditorConfig principales</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">La modifica del documento '{0}' non è supportata.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Opzioni EditorConfig di base</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">ドキュメント '{0}' の変更はサポートされていません。</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">コア EditorConfig オプション</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">'{0}' 문서 변경은 지원되지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">코어 EditorConfig 옵션</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">Zmiana dokumentu „{0}” nie jest obsługiwana.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Podstawowe opcje EditorConfig</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">Não há suporte para alterar o documento '{0}'.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Opções Principais do EditorConfig</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">Изменение документа "{0}" не поддерживается.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Основные параметры EditorConfig</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">Değişen belge '{0}' desteklenmiyor.</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Çekirdek EditorConfig seçenekleri</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">不支持更改文档“{0}”。</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">Core EditorConfig 选项</target>
......
......@@ -27,6 +27,11 @@
<target state="translated">不支援變更文件 '{0}'。</target>
<note />
</trans-unit>
<trans-unit id="Compilation_is_required_to_accomplish_the_task_but_is_not_supported_by_project_0">
<source>Compilation is required to accomplish the task but is not supported by project {0}.</source>
<target state="new">Compilation is required to accomplish the task but is not supported by project {0}.</target>
<note />
</trans-unit>
<trans-unit id="Core_EditorConfig_Options">
<source>Core EditorConfig Options</source>
<target state="translated">核心 EditorConfig 選項</target>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册