提交 76f25881 编写于 作者: J Johannes Rieken

debt - remove 'remote_schemes'-data, #48275

上级 5ebee3da
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
import { flatten, isFalsyOrEmpty } from 'vs/base/common/arrays'; import { flatten, isFalsyOrEmpty } from 'vs/base/common/arrays';
import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle'; import { IDisposable, dispose, Disposable } from 'vs/base/common/lifecycle';
import { TernarySearchTree, keys } from 'vs/base/common/map'; import { TernarySearchTree } from 'vs/base/common/map';
import { Schemas } from 'vs/base/common/network'; import { Schemas } from 'vs/base/common/network';
import * as resources from 'vs/base/common/resources'; import * as resources from 'vs/base/common/resources';
import URI from 'vs/base/common/uri'; import URI from 'vs/base/common/uri';
...@@ -161,12 +161,11 @@ class WorkspaceWatchLogic extends Disposable { ...@@ -161,12 +161,11 @@ class WorkspaceWatchLogic extends Disposable {
export class RemoteFileService extends FileService { export class RemoteFileService extends FileService {
private readonly _provider: Map<string, IFileSystemProvider>; private readonly _provider: Map<string, IFileSystemProvider>;
private readonly _lastKnownSchemes: string[];
constructor( constructor(
@IExtensionService private readonly _extensionService: IExtensionService, @IExtensionService private readonly _extensionService: IExtensionService,
@IStorageService private readonly _storageService: IStorageService, @IStorageService storageService: IStorageService,
@IEnvironmentService private readonly _environmentService: IEnvironmentService, @IEnvironmentService environmentService: IEnvironmentService,
@IConfigurationService configurationService: IConfigurationService, @IConfigurationService configurationService: IConfigurationService,
@IWorkspaceContextService contextService: IWorkspaceContextService, @IWorkspaceContextService contextService: IWorkspaceContextService,
@ILifecycleService lifecycleService: ILifecycleService, @ILifecycleService lifecycleService: ILifecycleService,
...@@ -175,16 +174,15 @@ export class RemoteFileService extends FileService { ...@@ -175,16 +174,15 @@ export class RemoteFileService extends FileService {
) { ) {
super( super(
contextService, contextService,
_environmentService, environmentService,
textResourceConfigurationService, textResourceConfigurationService,
configurationService, configurationService,
lifecycleService, lifecycleService,
_storageService, storageService,
notificationService notificationService
); );
this._provider = new Map<string, IFileSystemProvider>(); this._provider = new Map<string, IFileSystemProvider>();
this._lastKnownSchemes = JSON.parse(this._storageService.get('remote_schemes', undefined, '[]'));
this._register(new WorkspaceWatchLogic(this, configurationService, contextService)); this._register(new WorkspaceWatchLogic(this, configurationService, contextService));
} }
...@@ -195,7 +193,6 @@ export class RemoteFileService extends FileService { ...@@ -195,7 +193,6 @@ export class RemoteFileService extends FileService {
this._provider.set(scheme, provider); this._provider.set(scheme, provider);
this._onDidChangeFileSystemProviderRegistrations.fire({ added: true, scheme, provider }); this._onDidChangeFileSystemProviderRegistrations.fire({ added: true, scheme, provider });
this._storageService.store('remote_schemes', JSON.stringify(keys(this._provider)));
const reg = provider.onDidChangeFile(changes => { const reg = provider.onDidChangeFile(changes => {
// forward change events // forward change events
...@@ -211,19 +208,7 @@ export class RemoteFileService extends FileService { ...@@ -211,19 +208,7 @@ export class RemoteFileService extends FileService {
} }
canHandleResource(resource: URI): boolean { canHandleResource(resource: URI): boolean {
if (resource.scheme === Schemas.file || this._provider.has(resource.scheme)) { return resource.scheme === Schemas.file || this._provider.has(resource.scheme);
return true;
}
// TODO@remote
// this needs to go, but this already went viral
// https://github.com/Microsoft/vscode/issues/48275
if (this._lastKnownSchemes.indexOf(resource.scheme) < 0) {
return false;
}
if (!this._environmentService.isBuilt) {
console.warn('[remote] cache information required for ' + resource.toString());
}
return true;
} }
private _tryParseFileOperationResult(err: any): FileOperationResult { private _tryParseFileOperationResult(err: any): FileOperationResult {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册