pi-revit 0.2.2 → 0.2.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -183,10 +183,22 @@ namespace RevitBridge.Tools
|
|
|
183
183
|
else
|
|
184
184
|
{
|
|
185
185
|
markdown.Append(total == top.Count ? $"{total} match(es)." : $"top {top.Count} of {total} matches.");
|
|
186
|
+
|
|
187
|
+
// Same-named members from different namespaces (XYZ exists in
|
|
188
|
+
// Autodesk.Revit.DB and in helper namespaces) render identical
|
|
189
|
+
// signatures; disambiguate those lines with their full container path.
|
|
190
|
+
var ambiguous = top
|
|
191
|
+
.GroupBy(member => member.Signature, StringComparer.Ordinal)
|
|
192
|
+
.Where(group => group.Count() > 1)
|
|
193
|
+
.Select(group => group.Key)
|
|
194
|
+
.ToHashSet(StringComparer.Ordinal);
|
|
195
|
+
|
|
186
196
|
for (int i = 0; i < top.Count; i++)
|
|
187
197
|
{
|
|
188
198
|
var member = top[i];
|
|
189
199
|
string origin = member.Since is null ? member.Assembly : $"{member.Assembly}, since {member.Since}";
|
|
200
|
+
if (ambiguous.Contains(member.Signature))
|
|
201
|
+
origin += $", in {ContainingPath(member)}";
|
|
190
202
|
string line = $"\n{i + 1}. **{member.Signature}** — {KindLabel(member)} ({origin}) — {FirstSentence(member.Summary) ?? "(no summary)"}";
|
|
191
203
|
if (markdown.Length + line.Length > MaxMarkdownChars)
|
|
192
204
|
{
|
|
@@ -220,7 +232,14 @@ namespace RevitBridge.Tools
|
|
|
220
232
|
if (member.Exceptions is { Count: > 0 } exceptions)
|
|
221
233
|
lines.Add($"\n throws: {string.Join("; ", exceptions.Select(pair => $"{pair.Key} — {Cap(pair.Value, MaxParamDocChars)}"))}");
|
|
222
234
|
if (overloadCount > 1)
|
|
223
|
-
|
|
235
|
+
{
|
|
236
|
+
// The targeting example must be the query form the signature matcher
|
|
237
|
+
// actually accepts, so it is cut from the displayed signature itself —
|
|
238
|
+
// 'new XYZ(' for constructors, 'Wall.Create(' for methods.
|
|
239
|
+
int paren = member.Signature.IndexOf('(');
|
|
240
|
+
string example = paren >= 0 ? member.Signature[..(paren + 1)] : member.Composite + "(";
|
|
241
|
+
lines.Add($"\n note: {member.Composite} has {overloadCount} overload(s) listed; full docs shown for the simplest top-ranked one. To target another, continue the query past a parenthesis with its parameter types, e.g. '{example}'.");
|
|
242
|
+
}
|
|
224
243
|
foreach (string line in lines)
|
|
225
244
|
{
|
|
226
245
|
if (markdown.Length + line.Length > MaxMarkdownChars)
|
|
@@ -229,6 +248,16 @@ namespace RevitBridge.Tools
|
|
|
229
248
|
}
|
|
230
249
|
}
|
|
231
250
|
|
|
251
|
+
/// <summary>Namespace-qualified container for disambiguating display lines:
|
|
252
|
+
/// the type itself for types, the declaring type's full path for members.</summary>
|
|
253
|
+
private static string ContainingPath(ApiMember member)
|
|
254
|
+
{
|
|
255
|
+
if (member.Kind == 'T')
|
|
256
|
+
return member.FullName;
|
|
257
|
+
int dot = member.FullName.LastIndexOf('.');
|
|
258
|
+
return dot > 0 ? member.FullName[..dot] : member.FullName;
|
|
259
|
+
}
|
|
260
|
+
|
|
232
261
|
private static string KindLabel(ApiMember member) => member.IsConstructor ? "constructor" : member.Kind switch
|
|
233
262
|
{
|
|
234
263
|
'T' => "type",
|