resolveEditorBinary returns the path to the editor binary. On WSL, VSCODE_CWD points to the VS Code installation directory, so we can construct an absolute path to avoid the VS Code Server shell script. On macOS, VSCODE_CWD is the workspace directory, so the constructed path won't exist and we fall
(ideName string)
| 146 | // On macOS, VSCODE_CWD is the workspace directory, so the constructed |
| 147 | // path won't exist and we fall back to the bare command name. |
| 148 | func resolveEditorBinary(ideName string) string { |
| 149 | cwd, ok := os.LookupEnv("VSCODE_CWD") |
| 150 | if !ok { |
| 151 | return ideName |
| 152 | } |
| 153 | fullPath := cwd + "/bin/" + ideName |
| 154 | if _, err := os.Stat(fullPath); err == nil { |
| 155 | return fullPath |
| 156 | } |
| 157 | return ideName |
| 158 | } |
| 159 | |
| 160 | type debugMode struct { |
| 161 | enabled bool |
no outgoing calls