Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add placeholder types for fixing issues with TestInstantiationService #164295

Merged
merged 1 commit into from Oct 24, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -293,7 +293,7 @@ suite('Editor Modes - textToHtmlTokenizer', () => {

class Mode extends Disposable {

private readonly languageId = 'textToHtmlTokenizerMode';
public readonly languageId = 'textToHtmlTokenizerMode';
mjbvz marked this conversation as resolved.
Show resolved Hide resolved

constructor(
@ILanguageService languageService: ILanguageService
Expand Down
2 changes: 1 addition & 1 deletion src/vs/platform/instantiation/common/instantiation.ts
Expand Up @@ -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
* to their own tuple.
*/
type GetLeadingNonServiceArgs<Args> =
export type GetLeadingNonServiceArgs<Args> =
Args extends [...BrandedService[]] ? []
: Args extends [infer A, ...BrandedService[]] ? [A]
: Args extends [infer A, ...infer R] ? [A, ...GetLeadingNonServiceArgs<R>]
Expand Down
7 changes: 5 additions & 2 deletions src/vs/platform/instantiation/common/instantiationService.ts
Expand Up @@ -7,9 +7,9 @@ import { IdleValue } from 'vs/base/common/async';
import { Event } from 'vs/base/common/event';
import { illegalState } from 'vs/base/common/errors';
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 { 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 { LinkedList } from 'vs/base/common/linkedList';

Expand Down Expand Up @@ -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 {
mjbvz marked this conversation as resolved.
Show resolved Hide resolved
let _trace: Trace;
let result: any;
Expand Down