|
1 | 1 | using System;
|
2 | 2 | using System.Diagnostics;
|
| 3 | +using Castle.Core.Internal; |
3 | 4 | using Microsoft.Office.Core;
|
4 | 5 | using Microsoft.Vbe.Interop;
|
5 | 6 | using Rubberduck.Parsing.Symbols;
|
@@ -58,25 +59,28 @@ public void SetSelectionText(Declaration declaration)
|
58 | 59 | }
|
59 | 60 | else if (declaration != null && !declaration.IsBuiltIn && declaration.DeclarationType != DeclarationType.ClassModule && declaration.DeclarationType != DeclarationType.ProceduralModule)
|
60 | 61 | {
|
61 |
| - _selectionButton.Caption = string.Format("{0} ({1}): {2} ({3})", |
62 |
| - declaration.QualifiedName.QualifiedModuleName, |
| 62 | + _selectionButton.Caption = string.Format("{0}|{1}: {2} ({3}{4})", |
63 | 63 | declaration.QualifiedSelection.Selection,
|
| 64 | + declaration.QualifiedName.QualifiedModuleName, |
64 | 65 | declaration.IdentifierName,
|
65 |
| - RubberduckUI.ResourceManager.GetString("DeclarationType_" + declaration.DeclarationType)); |
| 66 | + RubberduckUI.ResourceManager.GetString("DeclarationType_" + declaration.DeclarationType), |
| 67 | + string.IsNullOrEmpty(declaration.AsTypeName) ? string.Empty : ": " + declaration.AsTypeName); |
66 | 68 | _selectionButton.TooltipText = string.IsNullOrEmpty(declaration.DescriptionString)
|
67 | 69 | ? _selectionButton.Caption
|
68 | 70 | : declaration.DescriptionString;
|
69 | 71 | }
|
70 | 72 | else if (declaration != null)
|
71 | 73 | {
|
| 74 | + // todo: confirm this is what we want, and then refator |
72 | 75 | var selection = _vbe.ActiveCodePane.GetQualifiedSelection();
|
73 | 76 | if (selection.HasValue)
|
74 | 77 | {
|
75 |
| - _selectionButton.Caption = string.Format("{0}: {1} ({2}) {3}", |
| 78 | + _selectionButton.Caption = string.Format("{0}|{1}: {2} ({3}{4})", |
| 79 | + selection.Value.Selection, |
76 | 80 | declaration.QualifiedName.QualifiedModuleName,
|
77 | 81 | declaration.IdentifierName,
|
78 | 82 | RubberduckUI.ResourceManager.GetString("DeclarationType_" + declaration.DeclarationType),
|
79 |
| - selection.Value.Selection); |
| 83 | + string.IsNullOrEmpty(declaration.AsTypeName) ? string.Empty : ": " + declaration.AsTypeName); |
80 | 84 | }
|
81 | 85 | _selectionButton.TooltipText = string.IsNullOrEmpty(declaration.DescriptionString)
|
82 | 86 | ? _selectionButton.Caption
|
|
0 commit comments