-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Try downloading repo for project wide IntelliSense (#171686)
* Try downloading repo for project wide IntelliSense For #170920 * Defer preload
- Loading branch information
Showing
6 changed files
with
109 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
42 changes: 42 additions & 0 deletions
42
extensions/typescript-language-features/src/remoteRepositories.browser.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/*--------------------------------------------------------------------------------------------- | ||
* Copyright (c) Microsoft Corporation. All rights reserved. | ||
* Licensed under the MIT License. See License.txt in the project root for license information. | ||
*--------------------------------------------------------------------------------------------*/ | ||
|
||
import { Extension, extensions, Uri } from 'vscode'; | ||
|
||
export interface RemoteHubApi { | ||
getProviderUri(uri: Uri): Uri; | ||
getProviderRootUri(uri: Uri): Uri; | ||
|
||
getVirtualUri(uri: Uri): Uri; | ||
getVirtualWorkspaceUri(uri: Uri): Uri | undefined; | ||
|
||
loadWorkspaceContents?(workspaceUri: Uri): Promise<boolean>; | ||
} | ||
|
||
namespace RemoteRepositories { | ||
|
||
let remoteHub: Extension<RemoteHubApi> | undefined; | ||
|
||
function getRemoteExtension(): Extension<RemoteHubApi> { | ||
if (remoteHub !== undefined) { | ||
return remoteHub; | ||
} | ||
|
||
remoteHub = extensions.getExtension<RemoteHubApi>('ms-vscode.remote-repositories') | ||
?? extensions.getExtension<RemoteHubApi>('GitHub.remoteHub') | ||
?? extensions.getExtension<RemoteHubApi>('GitHub.remoteHub-insiders'); | ||
|
||
if (remoteHub === undefined) { | ||
throw new Error(`No Remote repository extension found.`); | ||
} | ||
return remoteHub; | ||
} | ||
|
||
export function getApi(): Thenable<RemoteHubApi> { | ||
return getRemoteExtension().activate(); | ||
} | ||
} | ||
|
||
export default RemoteRepositories; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters