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

Commit

Permalink
Debugger compares length of bytes instead of length of string for hov…
Browse files Browse the repository at this point in the history
…er output. Fixes #1777
  • Loading branch information
xmattstrongx committed Jul 16, 2018
1 parent 0f40521 commit 4013c0f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 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,8 @@ 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`;
if (v.value && Buffer.byteLength(v.value) < v.len) {
val += `...+${v.len - Buffer.byteLength(v.value)} more`;
}
return {
result: v.unreadable ? ('<' + v.unreadable + '>') : ('"' + val + '"'),
Expand Down

0 comments on commit 4013c0f

Please sign in to comment.