add search to injector

This commit is contained in:
Johannes Rieken
2019-08-08 10:08:57 +02:00
parent 36135bd2ee
commit f47bf93da9
7 changed files with 98 additions and 19 deletions

View File

@@ -0,0 +1,37 @@
/*---------------------------------------------------------------------------------------------
* Copyright (c) Microsoft Corporation. All rights reserved.
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { IURITransformer } from 'vs/base/common/uriIpc';
import { createDecorator } from 'vs/platform/instantiation/common/instantiation';
import { URI, UriComponents } from 'vs/base/common/uri';
export interface IURITransformerService extends IURITransformer {
_serviceBrand: any;
}
export const IURITransformerService = createDecorator<IURITransformerService>('IURITransformerService');
export class URITransformerService implements IURITransformerService {
_serviceBrand: any;
transformIncoming: (uri: UriComponents) => UriComponents;
transformOutgoing: (uri: UriComponents) => UriComponents;
transformOutgoingURI: (uri: URI) => URI;
transformOutgoingScheme: (scheme: string) => string;
constructor(delegate: IURITransformer | null) {
if (!delegate) {
this.transformIncoming = arg => arg;
this.transformOutgoing = arg => arg;
this.transformOutgoingURI = arg => arg;
this.transformOutgoingScheme = arg => arg;
} else {
this.transformIncoming = delegate.transformIncoming.bind(delegate);
this.transformOutgoing = delegate.transformOutgoing.bind(delegate);
this.transformOutgoingURI = delegate.transformOutgoingURI.bind(delegate);
this.transformOutgoingScheme = delegate.transformOutgoingScheme.bind(delegate);
}
}
}