提交 5a60cdae 编写于 作者: S Sam Harwell

Add value text to Object Browser

上级 cd5604a5
......@@ -388,6 +388,21 @@ private void BuildXmlDocumentation(ISymbol symbol, Compilation compilation, _VSO
emittedDocs = true;
}
if (ShowValueDocumentation(symbol) && documentationComment.ValueText != null)
{
if (emittedDocs)
{
AddLineBreak();
}
AddLineBreak();
AddName(ServicesVSResources.Value_colon);
AddLineBreak();
AddText(formattingService.Format(documentationComment.ValueText, compilation));
emittedDocs = true;
}
if (documentationComment.RemarksText != null)
{
if (emittedDocs)
......@@ -447,6 +462,14 @@ private bool ShowReturnsDocumentation(ISymbol symbol)
|| symbol.Kind == SymbolKind.Property;
}
private bool ShowValueDocumentation(ISymbol symbol)
{
// <returns> is often used in places where <value> was originally intended. Allow either to be used in
// documentation comments since they are not likely to be used together and it's not clear which one a
// particular code base will be using more often.
return ShowReturnsDocumentation(symbol);
}
internal bool TryBuild(_VSOBJDESCOPTIONS options)
{
switch (_listItem)
......
......@@ -3462,6 +3462,15 @@ internal class ServicesVSResources {
}
}
/// <summary>
/// Looks up a localized string similar to Value:.
/// </summary>
internal static string Value_colon {
get {
return ResourceManager.GetString("Value_colon", resourceCulture);
}
}
/// <summary>
/// Looks up a localized string similar to Value returned by invocation is implicitly ignored.
/// </summary>
......
......@@ -1334,4 +1334,7 @@ I agree to all of the foregoing:</value>
<value>Type Parameter</value>
<comment>This string can be found under "Tools | Options | Text Editor | Basic | Code Style | Naming | Manage Specifications | + | Symbol kinds". All of the "NamingSpecification_VisualBasic_*" strings represent language constructs, and some of them are also actual keywords (NOT this one). Refers to the Visual Basic language concept of a "type parameter".</comment>
</data>
<data name="Value_colon" xml:space="preserve">
<value>Value:</value>
</data>
</root>
\ No newline at end of file
......@@ -462,6 +462,11 @@
<target state="translated">Zde přiřazená hodnota se nikdy nepoužije.</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">Hodnota vrácená voláním je implicitně ignorována.</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">Der hier zugewiesene Wert wird nie verwendet.</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">Der vom Aufruf zurückgegebene Wert wird implizit ignoriert.</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">El valor asignado aquí no se usa nunca</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">El valor devuelto por la invocación se omite implícitamente</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">La valeur affectée ici n'est jamais utilisée</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">La valeur retournée par invocation est implicitement ignorée</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">Il valore assegnato qui non viene mai usato</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">Il valore restituito dalla chiamata viene ignorato in modo implicito</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">ここで割り当てた値は一度も使用されません</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">呼び出しによって返された値が暗黙的に無視されます</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">여기에 할당된 값은 사용되지 않습니다.</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">호출로 반환된 값은 암시적으로 무시됩니다.</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">Przypisana tu wartość nigdy nie jest używana</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">Wartość zwracana przez wywołanie jest niejawnie ignorowana</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">O valor atribuído aqui nunca é usado</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">O valor retornado por chamada é implicitamente ignorado</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">Заданное здесь значение не используется.</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">Значение, возвращаемое вызовом, неявным образом игнорируется.</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">Burada atanan değer hiçbir zaman kullanılmadı</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">Çağrı ile döndürülen değer örtük olarak yok sayıldı</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">此处分配的值从未使用过</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">已隐式忽略调用所返回的值</target>
......
......@@ -462,6 +462,11 @@
<target state="translated">這裡指派的值從未使用過</target>
<note />
</trans-unit>
<trans-unit id="Value_colon">
<source>Value:</source>
<target state="new">Value:</target>
<note />
</trans-unit>
<trans-unit id="Value_returned_by_invocation_is_implicitly_ignored">
<source>Value returned by invocation is implicitly ignored</source>
<target state="translated">明確地忽略引動過程傳回的值</target>
......
......@@ -1196,6 +1196,111 @@ ServicesVSResources.Returns_colon & vbCrLf &
End Using
End Sub
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestDescription_XmlDocComment_Returns1()
Dim code =
<Code>
<![CDATA[
class C
{
/// <summary>
/// Describes the method.
/// </summary>
/// <returns>Returns a value.</returns>
public int M()
{
return 0;
}
}
]]>
</Code>
Using state = CreateLibraryManager(GetWorkspaceDefinition(code))
Dim library = state.GetLibrary()
Dim list = library.GetProjectList()
list = list.GetTypeList(0)
list = list.GetMemberList(0)
list.VerifyImmediateMemberDescriptions(
"public int M()" & vbCrLf &
$" {String.Format(ServicesVSResources.Member_of_0, "C")}" & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Summary_colon & vbCrLf &
"Describes the method." & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Returns_colon & vbCrLf &
"Returns a value.")
End Using
End Sub
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestDescription_XmlDocComment_Returns2()
Dim code =
<Code>
<![CDATA[
class C
{
/// <summary>
/// Gets a value.
/// </summary>
/// <returns>Returns a value.</returns>
public int M { get; }
}
]]>
</Code>
Using state = CreateLibraryManager(GetWorkspaceDefinition(code))
Dim library = state.GetLibrary()
Dim list = library.GetProjectList()
list = list.GetTypeList(0)
list = list.GetMemberList(0)
list.VerifyImmediateMemberDescriptions(
"public int M { get; }" & vbCrLf &
$" {String.Format(ServicesVSResources.Member_of_0, "C")}" & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Summary_colon & vbCrLf &
"Gets a value." & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Returns_colon & vbCrLf &
"Returns a value.")
End Using
End Sub
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestDescription_XmlDocComment_Value()
Dim code =
<Code>
<![CDATA[
class C
{
/// <summary>
/// Gets a value.
/// </summary>
/// <value>An integer value.</value>
public int M { get; }
}
]]>
</Code>
Using state = CreateLibraryManager(GetWorkspaceDefinition(code))
Dim library = state.GetLibrary()
Dim list = library.GetProjectList()
list = list.GetTypeList(0)
list = list.GetMemberList(0)
list.VerifyImmediateMemberDescriptions(
"public int M { get; }" & vbCrLf &
$" {String.Format(ServicesVSResources.Member_of_0, "C")}" & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Summary_colon & vbCrLf &
"Gets a value." & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Value_colon & vbCrLf &
"An integer value.")
End Using
End Sub
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestDescription_Operator_Add()
Dim code =
......
......@@ -2191,6 +2191,107 @@ ServicesVSResources.Remarks_colon & vbCrLf &
End Using
End Sub
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestDescription_XmlDocComments_Returns1()
Dim code =
<Code>
<![CDATA[
Class C
''' <summary>
''' Describes the method.
''' </summary>
''' <returns>Returns a value.</returns>
Function M() As Integer
Return 0
End Function
End Class
]]>
</Code>
Using state = CreateLibraryManager(GetWorkspaceDefinition(code))
Dim library = state.GetLibrary()
Dim list = library.GetProjectList()
list = list.GetTypeList(0)
list = list.GetMemberList(0)
list.VerifyImmediateMemberDescriptions(
"Public Function M() As Integer" & vbCrLf &
$" {String.Format(ServicesVSResources.Member_of_0, "C")}" & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Summary_colon & vbCrLf &
"Describes the method." & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Returns_colon & vbCrLf &
"Returns a value.")
End Using
End Sub
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestDescription_XmlDocComments_Returns2()
Dim code =
<Code>
<![CDATA[
Class C
''' <summary>
''' Gets a value.
''' </summary>
''' <returns>Returns a value.</returns>
ReadOnly Property M As Integer
End Class
]]>
</Code>
Using state = CreateLibraryManager(GetWorkspaceDefinition(code))
Dim library = state.GetLibrary()
Dim list = library.GetProjectList()
list = list.GetTypeList(0)
list = list.GetMemberList(0)
list.VerifyImmediateMemberDescriptions(
"Public ReadOnly Property M As Integer" & vbCrLf &
$" {String.Format(ServicesVSResources.Member_of_0, "C")}" & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Summary_colon & vbCrLf &
"Gets a value." & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Returns_colon & vbCrLf &
"Returns a value.")
End Using
End Sub
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestDescription_XmlDocComments_Value()
Dim code =
<Code>
<![CDATA[
Class C
''' <summary>
''' Gets a value.
''' </summary>
''' <value>An integer value.</value>
ReadOnly Property M As Integer
End Class
]]>
</Code>
Using state = CreateLibraryManager(GetWorkspaceDefinition(code))
Dim library = state.GetLibrary()
Dim list = library.GetProjectList()
list = list.GetTypeList(0)
list = list.GetMemberList(0)
list.VerifyImmediateMemberDescriptions(
"Public ReadOnly Property M As Integer" & vbCrLf &
$" {String.Format(ServicesVSResources.Member_of_0, "C")}" & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Summary_colon & vbCrLf &
"Gets a value." & vbCrLf &
"" & vbCrLf &
ServicesVSResources.Value_colon & vbCrLf &
"An integer value.")
End Using
End Sub
<WorkItem(942021, "http://vstfdevdiv:8080/DevDiv2/DevDiv/_workitems/edit/942021")>
<ConditionalFact(GetType(x86)), Trait(Traits.Feature, Traits.Features.ObjectBrowser)>
Public Sub TestNavInfo_Class()
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册