Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit44ad92b

Browse files
committed
Simplify getting remote ssh extension
1 parent01844de commit44ad92b

File tree

1 file changed

+11
-12
lines changed

1 file changed

+11
-12
lines changed

‎src/extension.ts

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -13,27 +13,26 @@ import { Storage } from "./storage"
1313
import{WorkspaceQuery,WorkspaceProvider}from"./workspacesProvider"
1414

1515
exportasyncfunctionactivate(ctx:vscode.ExtensionContext):Promise<void>{
16-
// The Remote SSH extension's proposed APIs are used to override
17-
// the SSH host name in VS Code itself. It's visually unappealing
18-
// having a lengthy name!
16+
// The Remote SSH extension's proposed APIs are used to override the SSH host
17+
// name in VS Code itself. It's visually unappealing having a lengthy name!
1918
//
2019
// This is janky, but that's alright since it provides such minimal
2120
// functionality to the extension.
22-
constopenRemoteSSHExtension=vscode.extensions.getExtension("anysphere.open-remote-ssh")
23-
//If the"anysphere.open-remote-ssh" extensionis available,itis used with priority
24-
//If it is not found, then the extension "ms-vscode-remote.remote-ssh" is sought as a fallback.
25-
//This is specifically for non-official VS Code distributions, such as Cursor.
26-
constuseRemoteSSHExtension=openRemoteSSHExtension
27-
?openRemoteSSHExtension
28-
:vscode.extensions.getExtension("ms-vscode-remote.remote-ssh")
29-
if(!useRemoteSSHExtension){
21+
//
22+
//Prefer the anysphere.open-remote-ssh extensionifitexists. This makes
23+
//our extension compatible with Cursor. Otherwise fall back to the official
24+
//SSH extension.
25+
constremoteSSHExtension=
26+
vscode.extensions.getExtension("anysphere.open-remote-ssh")||
27+
vscode.extensions.getExtension("ms-vscode-remote.remote-ssh")
28+
if(!remoteSSHExtension){
3029
thrownewError("Remote SSH extension not found")
3130
}
3231
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3332
constvscodeProposed:typeofvscode=(moduleasany)._load(
3433
"vscode",
3534
{
36-
filename:useRemoteSSHExtension?.extensionPath,
35+
filename:remoteSSHExtension?.extensionPath,
3736
},
3837
false,
3938
)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp