Skip to content

Commit 5f4d8e8

Browse files
Merge branch 'main' into dm-coder-inbox-oom-ood
2 parents eae596e + 6899b5d commit 5f4d8e8

File tree

11 files changed

+68
-23
lines changed

11 files changed

+68
-23
lines changed

CHANGELOG.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,19 @@
22

33
## Unreleased
44

5+
### Changed
6+
7+
- Make the MS Remote SSH extension part of an extension pack rather than a hard dependency, to enable
8+
using the plugin in other VSCode likes (cursor, windsurf, etc.)
9+
10+
## [v1.4.2](https://github.com/coder/vscode-coder/releases/tag/v1.4.2) (2025-03-07)
11+
512
### Fixed
613

714
- Remove agent singleton so that client TLS certificates are reloaded on every API request.
815
- Use Axios client to receive event stream so TLS settings are properly applied.
16+
- Set `usage-app=vscode` on `coder ssh` to fix deployment session counting.
17+
- Fix version comparison logic for checking wildcard support in "coder ssh"
918

1019
## [v1.4.1](https://github.com/coder/vscode-coder/releases/tag/v1.4.1) (2025-02-19)
1120

CLAUDE.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Coder Extension Development Guidelines
2+
3+
## Build and Test Commands
4+
5+
- Build: `yarn build`
6+
- Watch mode: `yarn watch`
7+
- Package: `yarn package`
8+
- Lint: `yarn lint`
9+
- Lint with auto-fix: `yarn lint:fix`
10+
- Run all tests: `yarn test`
11+
- Run specific test: `vitest ./src/filename.test.ts`
12+
- CI test mode: `yarn test:ci`
13+
14+
## Code Style Guidelines
15+
16+
- TypeScript with strict typing
17+
- No semicolons (see `.prettierrc`)
18+
- Trailing commas for all multi-line lists
19+
- 120 character line width
20+
- Use ES6 features (arrow functions, destructuring, etc.)
21+
- Use `const` by default; `let` only when necessary
22+
- Prefix unused variables with underscore (e.g., `_unused`)
23+
- Sort imports alphabetically in groups: external → parent → sibling
24+
- Error handling: wrap and type errors appropriately
25+
- Use async/await for promises, avoid explicit Promise construction where possible
26+
- Test files must be named `*.test.ts` and use Vitest

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,14 @@ Some dependencies are not directly used in the source but are required anyway.
125125
- `glob`, `nyc`, `vscode-test`, and `@vscode/test-electron` are currently unused
126126
but we need to switch back to them from `vitest`.
127127

128+
The coder client is vendored from coder/coder. Every now and then, we should be running `yarn upgrade coder --latest`
129+
to make sure we're using up to date versions of the client.
130+
128131
## Releasing
129132

130133
1. Check that the changelog lists all the important changes.
131134
2. Update the package.json version and add a version heading to the changelog.
132135
3. Push a tag matching the new package.json version.
133136
4. Update the resulting draft release with the changelog contents.
134137
5. Publish the draft release.
135-
6. Download the `.vsix` file from the release and upload to the marketplace.
138+
6. Download the `.vsix` file from the release and upload to both the [official VS Code Extension Marketplace](https://code.visualstudio.com/api/working-with-extensions/publishing-extension), and the [open-source VSX Registry](https://open-vsx.org/).

README.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,14 +4,20 @@
44
[!["Join us on
55
Discord"](https://badgen.net/discord/online-members/coder)](https://coder.com/chat?utm_source=github.com/coder/vscode-coder&utm_medium=github&utm_campaign=readme.md)
66

7-
The Coder Remote VS Code extension lets you open
8-
[Coder](https://github.com/coder/coder) workspaces with a single click.
7+
The Coder Remote extension lets you open [Coder](https://github.com/coder/coder)
8+
workspaces with a single click.
99

1010
- Open workspaces from the dashboard in a single click.
1111
- Automatically start workspaces when opened.
12-
- No command-line or local dependencies required - just install VS Code!
12+
- No command-line or local dependencies required - just install your editor!
1313
- Works in air-gapped or restricted networks. Just connect to your Coder
1414
deployment!
15+
- Supports multiple editors: VS Code, Cursor, and Windsurf.
16+
> [!NOTE]
17+
> The extension builds on VSCode provided implementations of SSH. Make sure
18+
> you have the correct ssh extension installed for your editor
19+
> (ms-vscode-remote.remote-ssh or codeium.windsurf-remote-openssh for
20+
> windsurf)
1521
1622
![Demo](https://github.com/coder/vscode-coder/raw/main/demo.gif?raw=true)
1723

package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"displayName": "Coder",
55
"description": "Open any workspace with a single click.",
66
"repository": "https://github.com/coder/vscode-coder",
7-
"version": "1.4.1",
7+
"version": "1.4.2",
88
"engines": {
99
"vscode": "^1.73.0"
1010
},
@@ -24,14 +24,14 @@
2424
"categories": [
2525
"Other"
2626
],
27+
"extensionPack": [
28+
"ms-vscode-remote.remote-ssh"
29+
],
2730
"activationEvents": [
2831
"onResolveRemoteAuthority:ssh-remote",
2932
"onCommand:coder.connect",
3033
"onUri"
3134
],
32-
"extensionDependencies": [
33-
"ms-vscode-remote.remote-ssh"
34-
],
3535
"main": "./dist/extension.js",
3636
"contributes": {
3737
"configuration": {

src/api.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ export async function waitForBuild(
225225
}
226226

227227
// This fetches the initial bunch of logs.
228-
const logs = await restClient.getWorkspaceBuildLogs(workspace.latest_build.id, new Date())
228+
const logs = await restClient.getWorkspaceBuildLogs(workspace.latest_build.id)
229229
logs.forEach((log) => writeEmitter.fire(log.output + "\r\n"))
230230

231231
// This follows the logs for new activity!

src/extension.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,13 @@ export async function activate(ctx: vscode.ExtensionContext): Promise<void> {
1919
// This is janky, but that's alright since it provides such minimal
2020
// functionality to the extension.
2121
//
22-
// Prefer the anysphere.open-remote-ssh extension if it exists. This makes
23-
// our extension compatible with Cursor. Otherwise fall back to the official
24-
// SSH extension.
22+
// Cursor and VSCode are covered by ms remote, and the only other is windsurf for now
23+
// Means that vscodium is not supported by this for now
2524
const remoteSSHExtension =
26-
vscode.extensions.getExtension("anysphere.open-remote-ssh") ||
25+
vscode.extensions.getExtension("codeium.windsurf-remote-openssh") ||
2726
vscode.extensions.getExtension("ms-vscode-remote.remote-ssh")
2827
if (!remoteSSHExtension) {
28+
vscode.window.showErrorMessage("Remote SSH extension not found, cannot activate Coder extension")
2929
throw new Error("Remote SSH extension not found")
3030
}
3131
// eslint-disable-next-line @typescript-eslint/no-explicit-any

src/featureSet.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,12 @@ describe("check version support", () => {
1111
expect(featureSetForVersion(semver.parse(v)).proxyLogDirectory).toBeTruthy()
1212
})
1313
})
14+
it("wildcard ssh", () => {
15+
;["v1.3.3+e491217", "v2.3.3+e491217"].forEach((v: string) => {
16+
expect(featureSetForVersion(semver.parse(v)).wildcardSSH).toBeFalsy()
17+
})
18+
;["v2.19.0", "v2.19.1", "v2.20.0+e491217", "v5.0.4+e491217"].forEach((v: string) => {
19+
expect(featureSetForVersion(semver.parse(v)).wildcardSSH).toBeTruthy()
20+
})
21+
})
1422
})

src/featureSet.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,6 @@ export function featureSetForVersion(version: semver.SemVer | null): FeatureSet
2222
// If this check didn't exist, VS Code connections would fail on
2323
// older versions because of an unknown CLI argument.
2424
proxyLogDirectory: (version?.compare("2.3.3") || 0) > 0 || version?.prerelease[0] === "devel",
25-
wildcardSSH: (version?.compare("2.19.0") || 0) > 0 || version?.prerelease[0] === "devel",
25+
wildcardSSH: (version ? version.compare("2.19.0") : -1) >= 0 || version?.prerelease[0] === "devel",
2626
}
2727
}

src/remote.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,7 +633,7 @@ export class Remote {
633633
const proxyCommand = featureSet.wildcardSSH
634634
? `${escape(binaryPath)}${headerArg} --global-config ${escape(
635635
path.dirname(this.storage.getSessionTokenPath(label)),
636-
)} ssh --stdio --network-info-dir ${escape(this.storage.getNetworkInfoPath())}${await this.formatLogArg(logDir)} --ssh-host-prefix ${hostPrefix} %h`
636+
)} ssh --stdio --usage-app=vscode --network-info-dir ${escape(this.storage.getNetworkInfoPath())}${await this.formatLogArg(logDir)} --ssh-host-prefix ${hostPrefix} %h`
637637
: `${escape(binaryPath)}${headerArg} vscodessh --network-info-dir ${escape(
638638
this.storage.getNetworkInfoPath(),
639639
)}${await this.formatLogArg(logDir)} --session-token-file ${escape(this.storage.getSessionTokenPath(label))} --url-file ${escape(

0 commit comments

Comments
 (0)