Skip to content

Commit

Permalink
Rename DAPClient
Browse files Browse the repository at this point in the history
  • Loading branch information
eliben committed Jul 1, 2020
1 parent 30a337d commit 41d6bad
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
3 changes: 2 additions & 1 deletion src/debugAdapter/README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Debug Adapter

This adapter is in development and is completely experimental.
This debug adapter is experimental, in-development code. If you
actually need to debug Go code, please use the default adapter.

See the [contribution documentation](../../docs/contributing.md) to learn how to develop the debug adapter.
6 changes: 3 additions & 3 deletions src/debugAdapter2/dapClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { DebugProtocol } from 'vscode-debugprotocol';
// - For receiving messages, subscibe to events this class emits.
// - 'event', 'respones', 'request' - each carrying an appropriate
// DebugProtocol type as an argument.
export class DapClient extends EventEmitter {
export class DAPClient extends EventEmitter {
private static readonly TWO_CRLF = '\r\n\r\n';

private outputStream: stream.Writable;
Expand Down Expand Up @@ -60,7 +60,7 @@ export class DapClient extends EventEmitter {
continue; // there may be more complete messages to process
}
} else {
const idx = this.rawData.indexOf(DapClient.TWO_CRLF);
const idx = this.rawData.indexOf(DAPClient.TWO_CRLF);
if (idx !== -1) {
const header = this.rawData.toString('utf8', 0, idx);
const lines = header.split('\r\n');
Expand All @@ -70,7 +70,7 @@ export class DapClient extends EventEmitter {
this.contentLength = +pair[1];
}
}
this.rawData = this.rawData.slice(idx + DapClient.TWO_CRLF.length);
this.rawData = this.rawData.slice(idx + DAPClient.TWO_CRLF.length);
continue;
}
}
Expand Down
9 changes: 5 additions & 4 deletions src/debugAdapter2/goDlvDebug.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
* Licensed under the MIT License. See LICENSE in the project root for license information.
*--------------------------------------------------------*/

// NOTE: This debug adapter is experimental, in-development code.
// NOTE: This debug adapter is experimental, in-development code. If you
// actually need to debug Go code, please use the default adapter.

import { ChildProcess, spawn } from 'child_process';
import * as fs from 'fs';
Expand All @@ -20,7 +21,7 @@ import {
import { DebugProtocol } from 'vscode-debugprotocol';

import { envPath } from '../goPath';
import { DapClient } from './dapClient';
import { DAPClient } from './dapClient';

interface LoadConfig {
// FollowPointers requests pointers to be automatically dereferenced.
Expand Down Expand Up @@ -124,7 +125,7 @@ function logError(...args: any[]) {
//
// Editor GoDlvDapDebugSession Delve
// +------------+ +--------------+-----------+ +------------+
// | DAP Client | <====> | DebugSession | DapClient | <====> | DAP Server |
// | DAP Client | <====> | DebugSession | DAPClient | <====> | DAP Server |
// +------------+ +--------------+-----------+ +------------+
export class GoDlvDapDebugSession extends LoggingDebugSession {
private readonly DEFAULT_DELVE_HOST = '127.0.0.1';
Expand Down Expand Up @@ -541,7 +542,7 @@ export class GoDlvDapDebugSession extends LoggingDebugSession {
// 'stdout' (str): delve emitted str to stdout
// 'stderr' (str): delve emitted str to stderr
// 'close' (rc): delve exited with return code rc
class DelveClient extends DapClient {
class DelveClient extends DAPClient {
private debugProcess: ChildProcess;

constructor(launchArgs: LaunchRequestArguments) {
Expand Down

0 comments on commit 41d6bad

Please sign in to comment.