mirror of
https://github.com/Microsoft/vscode
synced 2024-10-30 21:52:24 +00:00
Add placeholder types for fixing issues with TestInstantiationService
(#164295)
This commit is contained in:
parent
e63406a507
commit
a033a32f09
3 changed files with 7 additions and 4 deletions
|
@ -293,7 +293,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {
|
||||||
|
|
||||||
class Mode extends Disposable {
|
class Mode extends Disposable {
|
||||||
|
|
||||||
private readonly languageId = 'textToHtmlTokenizerMode';
|
public readonly languageId = 'textToHtmlTokenizerMode';
|
||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
@ILanguageService languageService: ILanguageService
|
@ILanguageService languageService: ILanguageService
|
||||||
|
|
|
@ -38,7 +38,7 @@ export const IInstantiationService = createDecorator<IInstantiationService>('ins
|
||||||
* Given a list of arguments as a tuple, attempt to extract the leading, non-service arguments
|
* Given a list of arguments as a tuple, attempt to extract the leading, non-service arguments
|
||||||
* to their own tuple.
|
* to their own tuple.
|
||||||
*/
|
*/
|
||||||
type GetLeadingNonServiceArgs<Args> =
|
export type GetLeadingNonServiceArgs<Args> =
|
||||||
Args extends [...BrandedService[]] ? []
|
Args extends [...BrandedService[]] ? []
|
||||||
: Args extends [infer A, ...BrandedService[]] ? [A]
|
: Args extends [infer A, ...BrandedService[]] ? [A]
|
||||||
: Args extends [infer A, ...infer R] ? [A, ...GetLeadingNonServiceArgs<R>]
|
: Args extends [infer A, ...infer R] ? [A, ...GetLeadingNonServiceArgs<R>]
|
||||||
|
|
|
@ -7,9 +7,9 @@ import { IdleValue } from 'vs/base/common/async';
|
||||||
import { Event } from 'vs/base/common/event';
|
import { Event } from 'vs/base/common/event';
|
||||||
import { illegalState } from 'vs/base/common/errors';
|
import { illegalState } from 'vs/base/common/errors';
|
||||||
import { toDisposable } from 'vs/base/common/lifecycle';
|
import { toDisposable } from 'vs/base/common/lifecycle';
|
||||||
import { SyncDescriptor } from 'vs/platform/instantiation/common/descriptors';
|
import { SyncDescriptor, SyncDescriptor0 } from 'vs/platform/instantiation/common/descriptors';
|
||||||
import { Graph } from 'vs/platform/instantiation/common/graph';
|
import { Graph } from 'vs/platform/instantiation/common/graph';
|
||||||
import { IInstantiationService, ServiceIdentifier, ServicesAccessor, _util } from 'vs/platform/instantiation/common/instantiation';
|
import { GetLeadingNonServiceArgs, IInstantiationService, ServiceIdentifier, ServicesAccessor, _util } from 'vs/platform/instantiation/common/instantiation';
|
||||||
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection';
|
||||||
import { LinkedList } from 'vs/base/common/linkedList';
|
import { LinkedList } from 'vs/base/common/linkedList';
|
||||||
|
|
||||||
|
@ -72,6 +72,9 @@ export class InstantiationService implements IInstantiationService {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
createInstance(ctorOrDescriptor: any | SyncDescriptor<any>, ...rest: any[]): any; // Comment out this line to fix type issues
|
||||||
|
createInstance<T>(descriptor: SyncDescriptor0<T>): T;
|
||||||
|
createInstance<Ctor extends new (...args: any[]) => any, R extends InstanceType<Ctor>>(ctor: Ctor, ...args: GetLeadingNonServiceArgs<ConstructorParameters<Ctor>>): R;
|
||||||
createInstance(ctorOrDescriptor: any | SyncDescriptor<any>, ...rest: any[]): any {
|
createInstance(ctorOrDescriptor: any | SyncDescriptor<any>, ...rest: any[]): any {
|
||||||
let _trace: Trace;
|
let _trace: Trace;
|
||||||
let result: any;
|
let result: any;
|
||||||
|
|
Loading…
Reference in a new issue