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

Commit

Permalink
Debugger now compares length of bytes instead of length of string for…
Browse files Browse the repository at this point in the history
… hover output. Fixes #1777 (#1790)
  • Loading branch information
xmattstrongx authored and ramya-rao-a committed Jul 16, 2018
1 parent aaf61a3 commit 195d4d7
Showing 1 changed file with 4 additions and 3 deletions.
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

0 comments on commit 195d4d7

Please sign in to comment.