Skip to content

Commit e8dc6c4

Browse files
committed
package.json: remove 'init' debug attribute
We use dlv in headless mode and dlv headless server always ignores --init flag. This seemed to be added in early days of vscode-go to support all delve flags available back then, and it never worked. Change-Id: Id8134b6b7c0ad119fc97862754925bd8d3464b54 Reviewed-on: https://go-review.googlesource.com/c/vscode-go/+/317150 Trust: Hyang-Ah Hana Kim <[email protected]> Run-TryBot: Hyang-Ah Hana Kim <[email protected]> TryBot-Result: kokoro <[email protected]> Reviewed-by: Polina Sokolova <[email protected]>
1 parent b9f1961 commit e8dc6c4

File tree

3 files changed

+4
-12
lines changed

3 files changed

+4
-12
lines changed

docs/debugging.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ showLog | If `true` and `logDest` is not set, Delve logs will be printed in t
114114
logOutput | Comma-separated list of Delve components (`debugger`, `gdbwire`, `lldbout`, `debuglineerr`, `rpc`) that should produce debug output when `showLog` is `true`. This corresponds to `dlv`'s `--log-output` flag.
115115
logDest | Absolute path to the delve log output file. This corresponds to `dlv`'s `--log-dest` flag, but number (used for file descriptor) is disallowed. Supported only in dlv-dap mode on Linux and Mac.
116116
buildFlags | Build flags to pass to the Go compiler. This corresponds to `dlv`'s `--build-flags` flag.
117-
dlvFlags | Extra flags passed to `dlv`. See `dlv help` for the full list of supported flags. This is useful when users need to pass less commonly used or new flags such as `--only-same-user`, `--check-go-version`. Note that some flags such as `--log-output`, `--log`, `--log-dest`, `--init`, `--api-version` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.
117+
dlvFlags | Extra flags passed to `dlv`. See `dlv help` for the full list of supported flags. This is useful when users need to pass less commonly used or new flags such as `--only-same-user`, `--check-go-version`. Note that some flags such as `--log-output`, `--log`, `--log-dest`, `--api-version` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.
118118
remotePath | If remote debugging (`mode`: `remote`), this should be the absolute path to the package being debugged on the remote machine. See the section on [Remote Debugging](#remote-debugging) for further details. [golang/vscode-go#45](https://github.com/golang/vscode-go/issues/45) is also relevant. Becomes the first mapping in substitutePath.
119119
substitutePath | An array of mappings from an absolute local path to an absolute remote path that is used by the debuggee. The debug adapter will replace the local path with the remote path in all of the calls. The mappings are applied in order, and the first matching mapping is used. This can be used to map files that have moved since the program was built, different remote paths, and symlinked files or directories. This is intended to be equivalent to the [substitute-path](https://github.com/go-delve/delve/tree/master/Documentation/cli#config) configuration, and will eventually configure substitute-path in Delve directly.
120120
cwd | The working directory to be used in running the program. If remote debugging (`mode`: `remote`), this should be the absolute path to the working directory being debugged on the local machine. See the section on [Remote Debugging](#remote-debugging) for further details. [golang/vscode-go#45](https://github.com/golang/vscode-go/issues/45) is also relevant.
@@ -455,4 +455,4 @@ This extension does not provide general support for debugging projects containin
455455
[Delve]: https://github.com/go-delve/delve
456456
[VS Code variables]: https://code.visualstudio.com/docs/editor/variables-reference
457457
[snippets]: https://code.visualstudio.com/docs/editor/userdefinedsnippets
458-
[Command Palette]: https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette
458+
[Command Palette]: https://code.visualstudio.com/docs/getstarted/userinterface#_command-palette

package.json

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -591,14 +591,9 @@
591591
"description": "Build flags, to be passed to the Go compiler. Maps to dlv's `--build-flags` flag.",
592592
"default": ""
593593
},
594-
"init": {
595-
"type": "string",
596-
"description": "Init file, executed by the terminal client. Maps to dlv's `--init` flag.",
597-
"default": ""
598-
},
599594
"dlvFlags": {
600595
"type": "array",
601-
"description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--init`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.",
596+
"description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.",
602597
"items": {
603598
"type": "string"
604599
},
@@ -780,7 +775,7 @@
780775
},
781776
"dlvFlags": {
782777
"type": "array",
783-
"description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--init`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.",
778+
"description": "Extra flags for `dlv`. See `dlv help` for the full list of supported. Flags such as `--log-output`, `--log`, `--log-dest`, `--api-version`, `--output`, `--backend` already have corresponding properties in the debug configuration, and flags such as `--listen` and `--headless` are used internally. If they are specified in `dlvFlags`, they may be ignored or cause an error.",
784779
"items": {
785780
"type": "string"
786781
},

src/debugAdapter/goDebug.ts

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,6 @@ export class Delve {
649649
if (launchArgs.buildFlags) {
650650
dlvArgs.push('--build-flags=' + launchArgs.buildFlags);
651651
}
652-
if (launchArgs.init) {
653-
dlvArgs.push('--init=' + launchArgs.init);
654-
}
655652
if (launchArgs.backend) {
656653
dlvArgs.push('--backend=' + launchArgs.backend);
657654
}

0 commit comments

Comments
 (0)