Skip to content

feat: add "Show Logs" command to help with network debugging #166

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Nov 14, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Add log file
  • Loading branch information
kylecarbs committed Nov 4, 2023
commit ba1717af5b31fa58b3393024a43da2c1072e7718
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "coder-remote",
"publisher": "coder",
"displayName": "Coder Remote",
"displayName": "Coder",
"description": "Open any workspace with a single click.",
"repository": "https://github.com/coder/vscode-coder",
"version": "0.1.25",
Expand Down
32 changes: 16 additions & 16 deletions src/remote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@ export class Remote {
await this.closeRemote()
return
}
const hasCoderLogs = (parsedVersion?.compare("2.3.3") || 0) >= 0 || parsedVersion?.prerelease[0] === "devel"

console.log("hasCoderLogs", hasCoderLogs)

// Find the workspace from the URI scheme provided!
try {
Expand Down Expand Up @@ -484,24 +487,21 @@ export class Remote {
// Now override with the user's config.
const userConfigSSH = vscode.workspace.getConfiguration("coder").get<string[]>("sshConfig") || []
// Parse the user's config into a Record<string, string>.
const userConfig = userConfigSSH.reduce(
(acc, line) => {
let i = line.indexOf("=")
const userConfig = userConfigSSH.reduce((acc, line) => {
let i = line.indexOf("=")
if (i === -1) {
i = line.indexOf(" ")
if (i === -1) {
i = line.indexOf(" ")
if (i === -1) {
// This line is malformed. The setting is incorrect, and does not match
// the pattern regex in the settings schema.
return acc
}
// This line is malformed. The setting is incorrect, and does not match
// the pattern regex in the settings schema.
return acc
}
const key = line.slice(0, i)
const value = line.slice(i + 1)
acc[key] = value
return acc
},
{} as Record<string, string>,
)
}
const key = line.slice(0, i)
const value = line.slice(i + 1)
acc[key] = value
return acc
}, {} as Record<string, string>)
const sshConfigOverrides = mergeSSHConfigValues(deploymentSSHConfig, userConfig)

let sshConfigFile = vscode.workspace.getConfiguration().get<string>("remote.SSH.configFile")
Expand Down