Table of Contents

Class ToolResultLimits

Namespace
RDCore.SDK.Server.Assistant
Assembly
RDCore.SDK.dll

How much a call of a tool answers at most: the cap of each kind of list, and of the text. A result cut at a cap says so, and says how many there are.

public static class ToolResultLimits
Inheritance
ToolResultLimits
Inherited Members

Remarks

A list beyond its cap is answered with its first items, its total, and truncated: true; its text ends with a line that says how many are shown (TruncatedLine<T>(CappedList<T>, CultureInfo)). An assistant narrows the call (a path, a query) to see the others.

Fields

Diagnostics

The most diagnostics a call answers.

public const int Diagnostics = 200

Field Value

int

OutlineEntries

The most declarations an outline answers, its members not counted.

public const int OutlineEntries = 1000

Field Value

int

References

The most places a call answers: references, definitions.

public const int References = 500

Field Value

int

Symbols

The most symbols a call answers.

public const int Symbols = 500

Field Value

int

TextLength

The most characters the text of a result has (CapText(string, CultureInfo)): 32,768.

public const int TextLength = 32768

Field Value

int

Methods

CapText(string, CultureInfo)

A text cut at TextLength characters, at the end of its last whole line, with a line that says where it is cut; the text itself when it is not longer.

public static string CapText(string text, CultureInfo culture)

Parameters

text string

The text.

culture CultureInfo

The language of the client's user interface.

Returns

string

The text, cut.

Cap<T>(IEnumerable<T>, int)

The first items of a list, at most cap of them, and how many there are.

public static CappedList<T> Cap<T>(IEnumerable<T> items, int cap)

Parameters

items IEnumerable<T>

The list, in the order a result has it.

cap int

The most items the result answers.

Returns

CappedList<T>

The items kept, and the total.

Type Parameters

T

The items.

Exceptions

ArgumentOutOfRangeException

cap is negative.

TruncatedLine<T>(CappedList<T>, CultureInfo)

The line a text ends with when its list is cut at its cap: how many are shown, of how many, and how to see the others.

public static string? TruncatedLine<T>(CappedList<T> list, CultureInfo culture)

Parameters

list CappedList<T>

The list.

culture CultureInfo

The language of the client's user interface.

Returns

string

The line; null for a list that is not cut.

Type Parameters

T

The items.