本文整理汇总了TypeScript中vscode-debugadapter.Handles类的典型用法代码示例。如果您正苦于以下问题:TypeScript Handles类的具体用法?TypeScript Handles怎么用?TypeScript Handles使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Handles类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的TypeScript代码示例。
示例1: variablesRequest
protected variablesRequest(response: DebugProtocol.VariablesResponse, args: DebugProtocol.VariablesArguments): void {
log('VariablesRequest');
let vari = this._variableHandles.get(args.variablesReference);
let variables;
if (vari.kind === GoReflectKind.Array || vari.kind === GoReflectKind.Slice || vari.kind === GoReflectKind.Map) {
variables = vari.children.map((v, i) => {
let { result, variablesReference} = this.convertDebugVariableToProtocolVariable(v, i);
return {
name: '[' + i + ']',
value: result,
variablesReference
};
});
} else {
variables = vari.children.map((v, i) => {
let { result, variablesReference} = this.convertDebugVariableToProtocolVariable(v, i);
return {
name: v.name,
value: result,
variablesReference
};
});
}
log(JSON.stringify(variables, null, ' '));
response.body = { variables };
this.sendResponse(response);
log('VariablesResponse');
}
开发者ID:casualjim,项目名称:vscode-go,代码行数:28,代码来源:goDebug.ts
示例2: logError
this.delve.call<DebugVariable[]>('ListFunctionArgs', [{ goroutineID: this.debugState.currentGoroutine.id, frame: args.frameId }], (err, args) => {
if (err) {
logError('Failed to list function args.');
return this.sendErrorResponse(response, 2006, 'Unable to list args: "{e}"', { e: err.toString() });
}
log(args);
let vars = args.concat(locals);
let scopes = new Array<Scope>();
let localVariables = {
name: 'Local',
addr: 0,
type: '',
realType: '',
kind: 0,
value: '',
len: 0,
cap: 0,
children: vars,
unreadable: ''
};
scopes.push(new Scope('Local', this._variableHandles.create(localVariables), false));
response.body = { scopes };
this.sendResponse(response);
log('ScopesResponse');
});
开发者ID:casualjim,项目名称:vscode-go,代码行数:26,代码来源:goDebug.ts
示例3: convertDebugVariableToProtocolVariable
private convertDebugVariableToProtocolVariable(v: DebugVariable, i: number): { result: string; variablesReference: number; } {
if (v.kind === GoReflectKind.Ptr || v.kind === GoReflectKind.UnsafePointer) {
if (v.children[0].addr === 0) {
return {
result: 'nil <' + v.type + '>',
variablesReference: 0
};
} else if (v.children[0].type === 'void') {
return {
result: 'void',
variablesReference: 0
};
} else {
return {
result: '<' + v.type + '>',
variablesReference: v.children[0].children.length > 0 ? this._variableHandles.create(v.children[0]) : 0
};
}
} else if (v.kind === GoReflectKind.Slice) {
return {
result: '<' + v.type + '> (length: ' + v.len + ', cap: ' + v.cap + ')',
variablesReference: this._variableHandles.create(v)
};
} else if (v.kind === GoReflectKind.Array) {
return {
result: '<' + v.type + '>',
variablesReference: this._variableHandles.create(v)
};
} else if (v.kind === GoReflectKind.String) {
return {
result: v.unreadable ? ('<' + v.unreadable + '>') : ('"' + v.value + '"'),
variablesReference: 0
};
} else {
return {
result: v.value || ('<' + v.type + '>'),
variablesReference: v.children.length > 0 ? this._variableHandles.create(v) : 0
};
}
}
开发者ID:casualjim,项目名称:vscode-go,代码行数:40,代码来源:goDebug.ts
注:本文中的vscode-debugadapter.Handles类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论