-
Notifications
You must be signed in to change notification settings - Fork 85
Closed
Description
The VS UI shows icons for locals, watches, etc to indicate the type of the evaluated value. We need to plumb this information through the protocol so debug adapters can indicate to the UI which icons and other visual states to apply.
Our proposal (implemented and verified in the VS Debug Adapter Host and VsDbg):
export interface EvaluateResponse extends Response {
body: {
// ...
/** Optional attributes describing the type to help with display.*/
evaluationAttribute?: EvaluationAttributes;
// ...
};
}
export interface Variable {
// ...
/** Optional attributes describing the type to help with display.*/
evaluationAttribute?: EvaluationAttributes;
// ...
}
export interface EvaluationAttributes {
/** Evaluation of the expression failed. Allows additional information to be passed during an evaluation failure.*/
isFailedEvaluation?: boolean;
/** Indicates that the object is read only.*/
isReadOnly?: boolean;
/** Indicates that the object is a raw string.*/
isRawString?: boolean;
/** Indicates that the object can have an Object ID created for it.*/
hasObjectId?: boolean;
/** Indicates that the object has an Object ID associated with it.*/
canHaveObjectId?: boolean;
/** Indicates that the evaluation had side effects.*/
hasSideEffects?: boolean;
/** Indicates that the object is static.*/
isStatic?: boolean;
/** Indicates that the object is a constant.*/
isConstant?: boolean;
/** Type of the expression: property, method, etc.*/
expressionType?: 'property' | 'method' | 'class' | 'data' | 'event' | 'baseClass' | 'innerClass' | 'interface' | 'mostDerivedClass';
/** Access type of the expression: public, private, etc.*/
accessLevel?: 'public' | 'private' | 'protected' | 'internal' | 'final';
}We considered implementing this via the Kind field on Variable (and adding that field to EvaluateResult), e.g. "kind"="public;property;static;readonly", but we didn't like that for two reasons:
- It allows you to specify "impossible" combinations, e.g.
public;private - It requires a bunch of extra logic to generate and parse these strings, and we felt that it was more appropriate to use JSON.
Namedrops: @weinand @richardstanton @gregg-miskelly @pieandcakes @digeff