mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-23 10:08:49 +01:00
add search to injector
This commit is contained in:
37
src/vs/workbench/api/common/extHostUriTransformerService.ts
Normal file
37
src/vs/workbench/api/common/extHostUriTransformerService.ts
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user