mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 17:48:56 +01:00
Move deltaExtensions related methods up to AbstractExtensionService
This commit is contained in:
@@ -506,7 +506,7 @@ export abstract class AbstractExtHostExtensionService extends Disposable impleme
|
||||
const host: IExtensionActivationHost = {
|
||||
folders: folders.map(folder => folder.uri),
|
||||
forceUsingSearch: localWithRemote,
|
||||
exists: (path) => this._hostUtils.exists(path),
|
||||
exists: (uri) => this._hostUtils.exists(uri.fsPath),
|
||||
checkExists: (folders, includes, token) => this._mainThreadWorkspaceProxy.$checkExists(folders, includes, token)
|
||||
};
|
||||
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import * as path from 'vs/base/common/path';
|
||||
import * as resources from 'vs/base/common/resources';
|
||||
import { URI, UriComponents } from 'vs/base/common/uri';
|
||||
import { CancellationTokenSource, CancellationToken } from 'vs/base/common/cancellation';
|
||||
import * as errors from 'vs/base/common/errors';
|
||||
@@ -19,7 +19,7 @@ export interface IExtensionActivationHost {
|
||||
readonly folders: readonly UriComponents[];
|
||||
readonly forceUsingSearch: boolean;
|
||||
|
||||
exists(path: string): Promise<boolean>;
|
||||
exists(uri: URI): Promise<boolean>;
|
||||
checkExists(folders: readonly UriComponents[], includes: string[], token: CancellationToken): Promise<boolean>;
|
||||
}
|
||||
|
||||
@@ -69,7 +69,7 @@ export function checkActivateWorkspaceContainsExtension(host: IExtensionActivati
|
||||
async function _activateIfFileName(host: IExtensionActivationHost, fileName: string, activate: (activationEvent: string) => void): Promise<void> {
|
||||
// find exact path
|
||||
for (const uri of host.folders) {
|
||||
if (await host.exists(path.join(URI.revive(uri).fsPath, fileName))) {
|
||||
if (await host.exists(resources.joinPath(URI.revive(uri), fileName))) {
|
||||
// the file was found
|
||||
activate(`workspaceContains:${fileName}`);
|
||||
return;
|
||||
|
||||
Reference in New Issue
Block a user