Skip to content

Commit

Permalink
src: improve start-up and session fail messages for remote dlv-dap
Browse files Browse the repository at this point in the history
  • Loading branch information
polinasok committed Dec 14, 2021
1 parent 15a266b commit 6b1de51
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion src/goDebugConfiguration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,7 @@ export class GoDebugConfigurationProvider implements vscode.DebugConfigurationPr
// but we have no way of detectng that with an external server.
this.showWarning(
'ignoreDlvDAPInRemoteModeWarning',
"'remote' mode with 'dlv-dap' debugAdapter must connect to an external `dlv --headless` server @ v1.7.3 or later. Older versions will fail with \"error layer=rpc rpc:invalid character 'C' looking for beginning of value\" logged to the terminal.\n"
"Using new 'remote' mode with 'dlv-dap' to connect to an external `dlv --headless` server via DAP."
);
} else if (debugConfiguration['port']) {
this.showWarning(
Expand Down
8 changes: 5 additions & 3 deletions src/goDebugFactory.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import { Logger, TimestampedLogger } from './goLogging';
import { DebugProtocol } from 'vscode-debugprotocol';
import { getWorkspaceFolderPath } from './util';
import { toolExecutionEnvironment } from './goEnv';
import { ShowMessageNotification } from 'vscode-languageserver-protocol';

export class GoDebugAdapterDescriptorFactory implements vscode.DebugAdapterDescriptorFactory {
constructor(private outputChannel?: vscode.OutputChannel) {}
Expand Down Expand Up @@ -80,9 +81,10 @@ export class GoDebugAdapterTrackerFactory implements vscode.DebugAdapterTrackerF
requestsSent > 0 &&
responsesReceived === 0 // happens when the rpc server doesn't understand DAP
) {
logger.warn(
"'remote' mode with 'dlv-dap' debugAdapter must connect to an external headless server started with dlv @ v1.7.3 or later.\n"
);
const err =
'Expected to connect to external `dlv --headless` server @ v1.7.3 or later via DAP. Older versions fail with "error layer=rpc rpc:invalid character \'C\' looking for beginning of value" logged to the terminal.\n';
logger.warn(err);
vscode.window.showErrorMessage(err);
}
logger.debug(`session ${session.id} will stop\n`);
},
Expand Down

0 comments on commit 6b1de51

Please sign in to comment.