Skip to content
This repository has been archived by the owner on Jul 15, 2023. It is now read-only.

Debugger compares length of bytes instead of length of string for hov… #1790

Merged
merged 1 commit into from
Jul 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions src/debugAdapter/goDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -567,7 +567,7 @@ class GoDebugSession extends DebugSession {
let clientVersion = this.delve.isApiV1 ? 1 : 2;
if (out.APIVersion !== clientVersion) {
logError(`Failed to get version: The remote server is running on delve v${out.APIVersion} API and the client is running v${clientVersion} API`);
return this.sendErrorResponse(response,
return this.sendErrorResponse(response,
3000,
'Failed to get version: The remote server is running on delve v{cli} API and the client is running v{ser} API',
{ ser: out.APIVersion.toString(), cli: clientVersion });
Expand Down Expand Up @@ -819,8 +819,9 @@ class GoDebugSession extends DebugSession {
};
} else if (v.kind === GoReflectKind.String) {
let val = v.value;
if (v.value && v.value.length < v.len) {
val += `...+${v.len - v.value.length} more`;
let byteLength = Buffer.byteLength(val || '');
if (v.value && byteLength < v.len) {
val += `...+${v.len - byteLength} more`;
}
return {
result: v.unreadable ? ('<' + v.unreadable + '>') : ('"' + val + '"'),
Expand Down