debt - reduce some explicit `any` use (#251182)

<!-- Thank you for submitting a Pull Request. Please:
* Read our Pull Request guidelines:
  https://github.com/microsoft/vscode/wiki/How-to-Contribute#pull-requests
* Associate an issue with the Pull Request.
* Ensure that the code is up-to-date with the `main` branch.
* Include a description of the proposed changes and how to test them.
-->
This commit is contained in:
Benjamin Pasero 2025-06-11 11:51:06 +02:00 committed by GitHub
parent f91d77fc7c
commit 0ac8174fbc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
40 changed files with 71 additions and 77 deletions

View File

@ -323,7 +323,7 @@ function activateLink(markdown: IMarkdownString, options: MarkdownRenderOptions,
}
function uriMassage(markdown: IMarkdownString, part: string): string {
let data: any;
let data: unknown;
try {
data = parse(decodeURIComponent(part));
} catch (e) {

View File

@ -32,7 +32,7 @@ export interface IBreadcrumbsItemEvent {
type: 'select' | 'focus';
item: BreadcrumbsItem;
node: HTMLElement;
payload: any;
payload: unknown;
}
export class BreadcrumbsWidget {

View File

@ -749,7 +749,7 @@ export interface IViewDeserializer<T extends ISerializableView> {
export interface ISerializedLeafNode {
type: 'leaf';
data: any;
data: unknown;
size: number;
visible?: boolean;
maximized?: boolean;

View File

@ -145,7 +145,7 @@ export interface IViewDeserializer<T extends ISerializableView> {
export interface ISerializedLeafNode {
type: 'leaf';
data: any;
data: unknown;
size: number;
visible?: boolean;
maximized?: boolean;

View File

@ -1743,7 +1743,7 @@ export class DeferredPromise<T> {
private completeCallback!: ValueCallback<T>;
private errorCallback!: (err: unknown) => void;
private outcome?: { outcome: DeferredOutcome.Rejected; value: any } | { outcome: DeferredOutcome.Resolved; value: T };
private outcome?: { outcome: DeferredOutcome.Rejected; value: unknown } | { outcome: DeferredOutcome.Resolved; value: T };
public get isRejected() {
return this.outcome?.outcome === DeferredOutcome.Rejected;

View File

@ -19,7 +19,7 @@ export interface IDataTransferItem {
id?: string;
asString(): Thenable<string>;
asFile(): IDataTransferFile | undefined;
value: any;
value: unknown;
}
export function createStringDataTransferItem(stringOrPromise: string | Promise<string>, id?: string): IDataTransferItem {

View File

@ -11,7 +11,7 @@ export function removeProperty(text: string, path: JSONPath, formattingOptions:
return setProperty(text, path, undefined, formattingOptions);
}
export function setProperty(text: string, originalPath: JSONPath, value: any, formattingOptions: FormattingOptions, getInsertionIndex?: (properties: string[]) => number): Edit[] {
export function setProperty(text: string, originalPath: JSONPath, value: unknown, formattingOptions: FormattingOptions, getInsertionIndex?: (properties: string[]) => number): Edit[] {
const path = originalPath.slice();
const errors: ParseError[] = [];
const root = parseTree(text, errors);

View File

@ -22,7 +22,7 @@ export function latestChangedValue<T extends IObservable<any>[]>(owner: DebugOwn
}
let hasLastChangedValue = false;
let lastChangedValue: any = undefined;
let lastChangedValue: unknown = undefined;
const result = observableFromEvent<any, void>(owner, cb => {
const store = new DisposableStore();

View File

@ -11,7 +11,7 @@ export interface IBuiltInExtension {
readonly name: string;
readonly version: string;
readonly repo: string;
readonly metadata: any;
readonly metadata: unknown;
}
export interface IProductWalkthrough {

View File

@ -6,7 +6,7 @@
import { IWebWorkerServerRequestHandler, IWebWorkerServerRequestHandlerFactory, WebWorkerServer } from './webWorker.js';
type MessageEvent = {
data: any;
data: unknown;
};
declare const globalThis: {

View File

@ -153,7 +153,7 @@ export interface IContentSizeChangedEvent {
export interface ITriggerEditorOperationEvent {
source: string | null | undefined;
handlerId: string;
payload: any;
payload: unknown;
}
export interface INewScrollPosition {

View File

@ -57,7 +57,7 @@ export class InlineCompletionsSource extends Disposable {
this._loggingEnabled = observableConfigValue('editor.inlineSuggest.logFetch', false, this._configurationService).recomputeInitiallyAndOnChange(this._store);
this._structuredFetchLogger = this._register(this._instantiationService.createInstance(StructuredLogger.cast<
{ kind: 'start'; requestId: number; context: unknown } & IRecordableEditorLogEntry
| { kind: 'end'; error: any; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry
| { kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry
>(),
'editor.inlineSuggest.logFetch.commandId'
));
@ -105,7 +105,7 @@ export class InlineCompletionsSource extends Disposable {
private _log(entry:
{ sourceId: string; kind: 'start'; requestId: number; context: unknown } & IRecordableEditorLogEntry
| { sourceId: string; kind: 'end'; error: any; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry
| { sourceId: string; kind: 'end'; error: unknown; durationMs: number; result: unknown; requestId: number } & IRecordableLogEntry
) {
if (this._loggingEnabled.get()) {
this._logService.info(formatRecordableLogEntry(entry));
@ -159,7 +159,7 @@ export class InlineCompletionsSource extends Disposable {
const startTime = new Date();
let providerResult: InlineCompletionProviderResult | undefined = undefined;
let error: any = undefined;
let error: unknown = undefined;
try {
providerResult = await provideInlineCompletions(
providers,

View File

@ -48,7 +48,7 @@ export async function getDocumentSemanticTokens(registry: LanguageFeatureRegistr
// Get tokens from all providers at the same time.
const results = await Promise.all(providers.map(async (provider) => {
let result: SemanticTokens | SemanticTokensEdits | null | undefined;
let error: any = null;
let error: unknown = null;
try {
result = await provider.provideDocumentSemanticTokens(model, (provider === lastProvider ? lastResultId : null), token);
} catch (err) {

View File

@ -119,7 +119,7 @@ export class InstantiationService implements IInstantiationService {
this._throwIfDisposed();
let _trace: Trace;
let result: any;
let result: unknown;
if (ctorOrDescriptor instanceof SyncDescriptor) {
_trace = Trace.traceCreation(this._enableTracing, ctorOrDescriptor.ctor);
result = this._createInstance(ctorOrDescriptor.ctor, ctorOrDescriptor.staticArguments.concat(rest), _trace);

View File

@ -646,13 +646,6 @@ export class WorkbenchTable<TRow> extends Table<TRow> {
}
}
export interface IOpenResourceOptions {
editorOptions: IEditorOptions;
sideBySide: boolean;
element: any;
payload: any;
}
export interface IOpenEvent<T> {
editorOptions: IEditorOptions;
sideBySide: boolean;

View File

@ -33,16 +33,16 @@ export interface IWebSocketCloseEvent {
/**
* Underlying event.
*/
readonly event: any | undefined;
readonly event: unknown | undefined;
}
export interface IWebSocket {
readonly onData: Event<ArrayBuffer>;
readonly onOpen: Event<void>;
readonly onClose: Event<IWebSocketCloseEvent | void>;
readonly onError: Event<any>;
readonly onError: Event<unknown>;
traceSocketEvent?(type: SocketDiagnosticsEventType, data?: VSBuffer | Uint8Array | ArrayBuffer | ArrayBufferView | any): void;
traceSocketEvent?(type: SocketDiagnosticsEventType, data?: VSBuffer | Uint8Array | ArrayBuffer | ArrayBufferView | unknown): void;
send(data: ArrayBuffer | ArrayBufferView): void;
close(): void;
}
@ -58,7 +58,7 @@ class BrowserWebSocket extends Disposable implements IWebSocket {
private readonly _onClose = this._register(new Emitter<IWebSocketCloseEvent>());
public readonly onClose = this._onClose.event;
private readonly _onError = this._register(new Emitter<any>());
private readonly _onError = this._register(new Emitter<unknown>());
public readonly onError = this._onError.event;
private readonly _debugLabel: string;
@ -127,7 +127,7 @@ class BrowserWebSocket extends Disposable implements IWebSocket {
// delay the error event processing in the hope of receiving a close event
// with more information
let pendingErrorEvent: any | null = null;
let pendingErrorEvent: unknown | null = null;
const sendPendingErrorNow = () => {
const err = pendingErrorEvent;
@ -137,13 +137,13 @@ class BrowserWebSocket extends Disposable implements IWebSocket {
const errorRunner = this._register(new RunOnceScheduler(sendPendingErrorNow, 0));
const sendErrorSoon = (err: any) => {
const sendErrorSoon = (err: unknown) => {
errorRunner.cancel();
pendingErrorEvent = err;
errorRunner.schedule();
};
const sendErrorNow = (err: any) => {
const sendErrorNow = (err: unknown) => {
errorRunner.cancel();
pendingErrorEvent = err;
sendPendingErrorNow();

View File

@ -120,11 +120,11 @@ export class RemoteAuthorityResolverError extends ErrorNoTelemetry {
public readonly _message: string | undefined;
public readonly _code: RemoteAuthorityResolverErrorCode;
public readonly _detail: any;
public readonly _detail: unknown;
public isHandled: boolean;
constructor(message?: string, code: RemoteAuthorityResolverErrorCode = RemoteAuthorityResolverErrorCode.Unknown, detail?: any) {
constructor(message?: string, code: RemoteAuthorityResolverErrorCode = RemoteAuthorityResolverErrorCode.Unknown, detail?: unknown) {
super(message);
this._message = message;

View File

@ -49,7 +49,7 @@ export function traceRpc(_target: any, key: string, descriptor: any) {
if (this.traceRpcArgs.simulatedLatency) {
await timeout(this.traceRpcArgs.simulatedLatency);
}
let result: any;
let result: unknown;
try {
result = await fn.apply(this, args);
} catch (e) {

View File

@ -8,7 +8,7 @@ import { setProperty } from '../../../base/common/jsonEdit.js';
import { FormattingOptions } from '../../../base/common/jsonFormatter.js';
export function edit(content: string, originalPath: JSONPath, value: any, formattingOptions: FormattingOptions): string {
export function edit(content: string, originalPath: JSONPath, value: unknown, formattingOptions: FormattingOptions): string {
const edit = setProperty(content, originalPath, value, formattingOptions)[0];
if (edit) {
content = content.substring(0, edit.offset) + edit.content + content.substring(edit.offset + edit.length);

View File

@ -11,7 +11,7 @@ import * as performance from '../../base/common/performance.js';
import { Event } from '../../base/common/event.js';
import { IURITransformer, transformOutgoingURIs } from '../../base/common/uriIpc.js';
import { IServerChannel } from '../../base/parts/ipc/common/ipc.js';
import { ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyExpr, ContextKeyExpression, ContextKeyGreaterEqualsExpr, ContextKeyGreaterExpr, ContextKeyInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyNotInExpr, ContextKeyRegexExpr, ContextKeySmallerEqualsExpr, ContextKeySmallerExpr, IContextKeyExprMapper } from '../../platform/contextkey/common/contextkey.js';
import { ContextKeyDefinedExpr, ContextKeyEqualsExpr, ContextKeyExpr, ContextKeyExpression, ContextKeyGreaterEqualsExpr, ContextKeyGreaterExpr, ContextKeyInExpr, ContextKeyNotEqualsExpr, ContextKeyNotExpr, ContextKeyNotInExpr, ContextKeyRegexExpr, ContextKeySmallerEqualsExpr, ContextKeySmallerExpr, ContextKeyValue, IContextKeyExprMapper } from '../../platform/contextkey/common/contextkey.js';
import { IExtensionGalleryService, IExtensionManagementService, InstallExtensionSummary, InstallOptions } from '../../platform/extensionManagement/common/extensionManagement.js';
import { ExtensionManagementCLI } from '../../platform/extensionManagement/common/extensionManagementCLI.js';
import { IExtensionsScannerService, toExtensionDescription } from '../../platform/extensionManagement/common/extensionsScannerService.js';
@ -238,30 +238,30 @@ export class RemoteExtensionsScannerService implements IRemoteExtensionsScannerS
mapNot(key: string): ContextKeyExpression {
return ContextKeyNotExpr.create(key);
}
mapEquals(key: string, value: any): ContextKeyExpression {
mapEquals(key: string, value: ContextKeyValue): ContextKeyExpression {
if (key === 'resourceScheme' && typeof value === 'string') {
return ContextKeyEqualsExpr.create(key, _mapResourceSchemeValue(value, false));
} else {
return ContextKeyEqualsExpr.create(key, value);
}
}
mapNotEquals(key: string, value: any): ContextKeyExpression {
mapNotEquals(key: string, value: ContextKeyValue): ContextKeyExpression {
if (key === 'resourceScheme' && typeof value === 'string') {
return ContextKeyNotEqualsExpr.create(key, _mapResourceSchemeValue(value, false));
} else {
return ContextKeyNotEqualsExpr.create(key, value);
}
}
mapGreater(key: string, value: any): ContextKeyExpression {
mapGreater(key: string, value: ContextKeyValue): ContextKeyExpression {
return ContextKeyGreaterExpr.create(key, value);
}
mapGreaterEquals(key: string, value: any): ContextKeyExpression {
mapGreaterEquals(key: string, value: ContextKeyValue): ContextKeyExpression {
return ContextKeyGreaterEqualsExpr.create(key, value);
}
mapSmaller(key: string, value: any): ContextKeyExpression {
mapSmaller(key: string, value: ContextKeyValue): ContextKeyExpression {
return ContextKeySmallerExpr.create(key, value);
}
mapSmallerEquals(key: string, value: any): ContextKeyExpression {
mapSmallerEquals(key: string, value: ContextKeyValue): ContextKeyExpression {
return ContextKeySmallerEqualsExpr.create(key, value);
}
mapRegex(key: string, regexp: RegExp | null): ContextKeyRegexExpr {

View File

@ -45,7 +45,7 @@ export class MainThreadConfiguration implements MainThreadConfigurationShape {
this._configurationListener.dispose();
}
$updateConfigurationOption(target: ConfigurationTarget | null, key: string, value: any, overrides: IConfigurationOverrides | undefined, scopeToLanguage: boolean | undefined): Promise<void> {
$updateConfigurationOption(target: ConfigurationTarget | null, key: string, value: unknown, overrides: IConfigurationOverrides | undefined, scopeToLanguage: boolean | undefined): Promise<void> {
overrides = { resource: overrides?.resource ? URI.revive(overrides.resource) : undefined, overrideIdentifier: overrides?.overrideIdentifier };
return this.writeConfiguration(target, key, value, overrides, scopeToLanguage);
}
@ -55,7 +55,7 @@ export class MainThreadConfiguration implements MainThreadConfigurationShape {
return this.writeConfiguration(target, key, undefined, overrides, scopeToLanguage);
}
private writeConfiguration(target: ConfigurationTarget | null, key: string, value: any, overrides: IConfigurationOverrides, scopeToLanguage: boolean | undefined): Promise<void> {
private writeConfiguration(target: ConfigurationTarget | null, key: string, value: unknown, overrides: IConfigurationOverrides, scopeToLanguage: boolean | undefined): Promise<void> {
target = target !== null && target !== undefined ? target : this.deriveConfigurationTarget(key, overrides);
const configurationValue = this.configurationService.inspect(key, overrides);
switch (target) {
@ -72,7 +72,7 @@ export class MainThreadConfiguration implements MainThreadConfigurationShape {
}
}
private _updateValue(key: string, value: any, configurationTarget: ConfigurationTarget, overriddenValue: any | undefined, overrides: IConfigurationOverrides, scopeToLanguage: boolean | undefined): Promise<void> {
private _updateValue(key: string, value: unknown, configurationTarget: ConfigurationTarget, overriddenValue: any | undefined, overrides: IConfigurationOverrides, scopeToLanguage: boolean | undefined): Promise<void> {
overrides = scopeToLanguage === true ? overrides
: scopeToLanguage === false ? { resource: overrides.resource }
: overrides.overrideIdentifier && overriddenValue !== undefined ? overrides

View File

@ -68,6 +68,7 @@ import * as notebookCommon from '../../contrib/notebook/common/notebookCommon.js
import { CellExecutionUpdateType } from '../../contrib/notebook/common/notebookExecutionService.js';
import { ICellExecutionComplete, ICellExecutionStateUpdate } from '../../contrib/notebook/common/notebookExecutionStateService.js';
import { ICellRange } from '../../contrib/notebook/common/notebookRange.js';
import { ISCMHistoryOptions } from '../../contrib/scm/common/history.js';
import { InputValidationType } from '../../contrib/scm/common/scm.js';
import { IWorkspaceSymbol, NotebookPriorityInfo } from '../../contrib/search/common/search.js';
import { IRawClosedNotebookFileMatch } from '../../contrib/search/common/searchNotebookHelpers.js';
@ -203,7 +204,7 @@ export interface MainThreadSecretStateShape extends IDisposable {
}
export interface MainThreadConfigurationShape extends IDisposable {
$updateConfigurationOption(target: ConfigurationTarget | null, key: string, value: any, overrides: IConfigurationOverrides | undefined, scopeToLanguage: boolean | undefined): Promise<void>;
$updateConfigurationOption(target: ConfigurationTarget | null, key: string, value: unknown, overrides: IConfigurationOverrides | undefined, scopeToLanguage: boolean | undefined): Promise<void>;
$removeConfigurationOption(target: ConfigurationTarget | null, key: string, overrides: IConfigurationOverrides | undefined, scopeToLanguage: boolean | undefined): Promise<void>;
}
@ -1409,7 +1410,7 @@ export interface ExtHostLanguageModelToolsShape {
$invokeTool(dto: IToolInvocation, token: CancellationToken): Promise<Dto<IToolResult> | SerializableObjectWithBuffers<Dto<IToolResult>>>;
$countTokensForInvocation(callId: string, input: string, token: CancellationToken): Promise<number>;
$prepareToolInvocation(toolId: string, parameters: any, token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
$prepareToolInvocation(toolId: string, parameters: unknown, token: CancellationToken): Promise<IPreparedToolInvocation | undefined>;
}
export interface MainThreadUrlsShape extends IDisposable {
@ -2570,7 +2571,7 @@ export interface ExtHostSCMShape {
$validateInput(sourceControlHandle: number, value: string, cursorPosition: number): Promise<[string | IMarkdownString, number] | undefined>;
$setSelectedSourceControl(selectedSourceControlHandle: number | undefined): Promise<void>;
$provideHistoryItemRefs(sourceControlHandle: number, historyItemRefs: string[] | undefined, token: CancellationToken): Promise<SCMHistoryItemRefDto[] | undefined>;
$provideHistoryItems(sourceControlHandle: number, options: any, token: CancellationToken): Promise<SCMHistoryItemDto[] | undefined>;
$provideHistoryItems(sourceControlHandle: number, options: ISCMHistoryOptions, token: CancellationToken): Promise<SCMHistoryItemDto[] | undefined>;
$provideHistoryItemChanges(sourceControlHandle: number, historyItemId: string, historyItemParentId: string | undefined, token: CancellationToken): Promise<SCMHistoryItemChangeDto[] | undefined>;
$resolveHistoryItemChatContext(sourceControlHandle: number, historyItemId: string, token: CancellationToken): Promise<string | undefined>;
$resolveHistoryItemRefsCommonAncestor(sourceControlHandle: number, historyItemRefs: string[], token: CancellationToken): Promise<string | undefined>;

View File

@ -247,7 +247,7 @@ export class ExtHostConfigProvider {
}
return result;
},
update: (key: string, value: any, extHostConfigurationTarget: ExtHostConfigurationTarget | boolean, scopeToLanguage?: boolean) => {
update: (key: string, value: unknown, extHostConfigurationTarget: ExtHostConfigurationTarget | boolean, scopeToLanguage?: boolean) => {
key = section ? `${section}.${key}` : key;
const target = parseConfigurationTarget(extHostConfigurationTarget);
if (value !== undefined) {
@ -299,7 +299,7 @@ export class ExtHostConfigProvider {
set: (_target: any, property: PropertyKey, _value: any) => { throw new Error(`TypeError: Cannot assign to read only property '${String(property)}' of object`); },
deleteProperty: (_target: any, property: PropertyKey) => { throw new Error(`TypeError: Cannot delete read only property '${String(property)}' of object`); },
defineProperty: (_target: any, property: PropertyKey) => { throw new Error(`TypeError: Cannot define property '${String(property)}' for a readonly object`); },
setPrototypeOf: (_target: any) => { throw new Error(`TypeError: Cannot set prototype for a readonly object`); },
setPrototypeOf: (_target: unknown) => { throw new Error(`TypeError: Cannot set prototype for a readonly object`); },
isExtensible: () => false,
preventExtensions: () => true
}) : target;

View File

@ -220,7 +220,7 @@ export class ExtHostLanguageModelTools implements ExtHostLanguageModelToolsShape
return model;
}
async $prepareToolInvocation(toolId: string, input: any, token: CancellationToken): Promise<IPreparedToolInvocation | undefined> {
async $prepareToolInvocation(toolId: string, input: unknown, token: CancellationToken): Promise<IPreparedToolInvocation | undefined> {
const item = this._registeredTools.get(toolId);
if (!item) {
throw new Error(`Unknown tool ${toolId}`);

View File

@ -263,7 +263,7 @@ export class ExtHostLanguageModels implements ExtHostLanguageModelsShape {
sendSoon({ index: fragment.index, part });
});
let value: any;
let value: unknown;
try {
value = data.provider.provideLanguageModelResponse(

View File

@ -31,7 +31,7 @@ interface IKernelData {
extensionId: ExtensionIdentifier;
controller: vscode.NotebookController;
onDidChangeSelection: Emitter<{ selected: boolean; notebook: vscode.NotebookDocument }>;
onDidReceiveMessage: Emitter<{ editor: vscode.NotebookEditor; message: any }>;
onDidReceiveMessage: Emitter<{ editor: vscode.NotebookEditor; message: unknown }>;
associatedNotebooks: ResourceMap<boolean>;
}
@ -135,7 +135,7 @@ export class ExtHostNotebookKernels implements ExtHostNotebookKernelsShape {
let isDisposed = false;
const onDidChangeSelection = new Emitter<{ selected: boolean; notebook: vscode.NotebookDocument }>();
const onDidReceiveMessage = new Emitter<{ editor: vscode.NotebookEditor; message: any }>();
const onDidReceiveMessage = new Emitter<{ editor: vscode.NotebookEditor; message: unknown }>();
const data: INotebookKernelDto2 = {
id: createKernelId(extension.identifier, id),

View File

@ -12,7 +12,7 @@ import * as vscode from 'vscode';
export class ExtHostNotebookRenderers implements ExtHostNotebookRenderersShape {
private readonly _rendererMessageEmitters = new Map<string /* rendererId */, Emitter<{ editor: vscode.NotebookEditor; message: any }>>();
private readonly _rendererMessageEmitters = new Map<string /* rendererId */, Emitter<{ editor: vscode.NotebookEditor; message: unknown }>>();
private readonly proxy: MainThreadNotebookRenderersShape;
constructor(mainContext: IMainContext, private readonly _extHostNotebook: ExtHostNotebookController) {

View File

@ -1085,7 +1085,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
}
}
async $provideHistoryItems(sourceControlHandle: number, options: any, token: CancellationToken): Promise<SCMHistoryItemDto[] | undefined> {
async $provideHistoryItems(sourceControlHandle: number, options: vscode.SourceControlHistoryOptions, token: CancellationToken): Promise<SCMHistoryItemDto[] | undefined> {
try {
const historyProvider = this._sourceControls.get(sourceControlHandle)?.historyProvider;
const historyItems = await historyProvider?.provideHistoryItems(options, token);

View File

@ -406,7 +406,7 @@ export namespace MarkdownString {
if (!part) {
return part;
}
let data: any;
let data: unknown;
try {
data = parse(part);
} catch (e) {

View File

@ -584,9 +584,9 @@ export class RemoteAuthorityResolverError extends Error {
public readonly _message: string | undefined;
public readonly _code: RemoteAuthorityResolverErrorCode;
public readonly _detail: any;
public readonly _detail: unknown;
constructor(message?: string, code: RemoteAuthorityResolverErrorCode = RemoteAuthorityResolverErrorCode.Unknown, detail?: any) {
constructor(message?: string, code: RemoteAuthorityResolverErrorCode = RemoteAuthorityResolverErrorCode.Unknown, detail?: unknown) {
super(message);
this._message = message;

View File

@ -20,7 +20,7 @@ class ArrayBufferSet {
}
export function serializeWebviewMessage(
message: any,
message: unknown,
options: { serializeBuffersForPostMessage?: boolean }
): { message: string; buffers: VSBuffer[] } {
if (options.serializeBuffersForPostMessage) {
@ -83,7 +83,7 @@ function getTypedArrayType(value: ArrayBufferView): extHostProtocol.WebviewMessa
return undefined;
}
export function deserializeWebviewMessage(jsonMessage: string, buffers: VSBuffer[]): { message: any; arrayBuffers: ArrayBuffer[] } {
export function deserializeWebviewMessage(jsonMessage: string, buffers: VSBuffer[]): { message: unknown; arrayBuffers: ArrayBuffer[] } {
const arrayBuffers: ArrayBuffer[] = buffers.map(buffer => {
const arrayBuffer = new ArrayBuffer(buffer.byteLength);
const uint8Array = new Uint8Array(arrayBuffer);
@ -117,6 +117,6 @@ export function deserializeWebviewMessage(jsonMessage: string, buffers: VSBuffer
return value;
};
const message = JSON.parse(jsonMessage, reviver);
const message = JSON.parse(jsonMessage, reviver) as unknown;
return { message, arrayBuffers };
}

View File

@ -576,7 +576,7 @@ export class BreadcrumbsControl {
}
}
private _getEditorGroup(data: object): SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE | undefined {
private _getEditorGroup(data: unknown): SIDE_GROUP_TYPE | ACTIVE_GROUP_TYPE | undefined {
if (data === BreadcrumbsControl.Payload_RevealAside) {
return SIDE_GROUP;
} else if (data === BreadcrumbsControl.Payload_Reveal) {

View File

@ -82,7 +82,7 @@ export abstract class BreadcrumbsPicker {
setTimeout(() => this._tree.dispose(), 0); // tree cannot be disposed while being opened...
}
async show(input: any, maxHeight: number, width: number, arrowSize: number, arrowOffset: number): Promise<void> {
async show(input: FileElement | OutlineElement2, maxHeight: number, width: number, arrowSize: number, arrowOffset: number): Promise<void> {
const theme = this._themeService.getColorTheme();
const color = theme.getColor(breadcrumbsPickerBackground);

View File

@ -74,7 +74,7 @@ function assignStackFrameContext(element: StackFrame, context: any) {
return context;
}
export function getContext(element: CallStackItem | null): any {
export function getContext(element: CallStackItem | null) {
if (element instanceof StackFrame) {
return assignStackFrameContext(element, {});
} else if (element instanceof Thread) {

View File

@ -332,10 +332,10 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
}
updateValue(key: string, value: any): Promise<void>;
updateValue(key: string, value: any, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides): Promise<void>;
updateValue(key: string, value: any, target: ConfigurationTarget): Promise<void>;
updateValue(key: string, value: any, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides, target: ConfigurationTarget, options?: IConfigurationUpdateOptions): Promise<void>;
async updateValue(key: string, value: any, arg3?: any, arg4?: any, options?: any): Promise<void> {
updateValue(key: string, value: unknown, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides): Promise<void>;
updateValue(key: string, value: unknown, target: ConfigurationTarget): Promise<void>;
updateValue(key: string, value: unknown, overrides: IConfigurationOverrides | IConfigurationUpdateOverrides, target: ConfigurationTarget, options?: IConfigurationUpdateOptions): Promise<void>;
async updateValue(key: string, value: unknown, arg3?: any, arg4?: any, options?: any): Promise<void> {
const overrides: IConfigurationUpdateOverrides | undefined = isConfigurationUpdateOverrides(arg3) ? arg3
: isConfigurationOverrides(arg3) ? { resource: arg3.resource, overrideIdentifiers: arg3.overrideIdentifier ? [arg3.overrideIdentifier] : undefined } : undefined;
const target: ConfigurationTarget | undefined = overrides ? arg4 : arg3;
@ -996,7 +996,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
return validWorkspaceFolders;
}
private async writeConfigurationValue(key: string, value: any, target: ConfigurationTarget, overrides: IConfigurationUpdateOverrides | undefined, options?: IConfigurationUpdateOverrides): Promise<void> {
private async writeConfigurationValue(key: string, value: unknown, target: ConfigurationTarget, overrides: IConfigurationUpdateOverrides | undefined, options?: IConfigurationUpdateOverrides): Promise<void> {
if (!this.instantiationService) {
throw new Error('Cannot write configuration because the configuration service is not yet ready to accept writes.');
}
@ -1080,7 +1080,7 @@ export class WorkspaceService extends Disposable implements IWorkbenchConfigurat
}
}
private deriveConfigurationTargets(key: string, value: any, inspect: IConfigurationValue<any>): ConfigurationTarget[] {
private deriveConfigurationTargets(key: string, value: unknown, inspect: IConfigurationValue<any>): ConfigurationTarget[] {
if (equals(value, inspect.value)) {
return [];
}

View File

@ -112,7 +112,7 @@ export class ConfigurationEditingError extends ErrorNoTelemetry {
export interface IConfigurationValue {
key: string;
value: any;
value: unknown;
}
export interface IConfigurationEditingOptions extends IConfigurationUpdateOptions {

View File

@ -25,7 +25,7 @@ export class JSONEditingError extends Error {
export interface IJSONValue {
path: JSONPath;
value: any;
value: unknown;
}
export interface IJSONEditingService {

View File

@ -143,14 +143,14 @@ export abstract class BaseConfigurationResolverService extends AbstractVariableR
this.resolvableVariables.add('input');
}
override async resolveWithInteractionReplace(folder: IWorkspaceFolderData | undefined, config: any, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<any> {
override async resolveWithInteractionReplace(folder: IWorkspaceFolderData | undefined, config: unknown, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<any> {
const parsed = ConfigurationResolverExpression.parse(config);
await this.resolveWithInteraction(folder, parsed, section, variables, target);
return parsed.toObject();
}
override async resolveWithInteraction(folder: IWorkspaceFolderData | undefined, config: any, section?: string, variableToCommandMap?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<Map<string, string> | undefined> {
override async resolveWithInteraction(folder: IWorkspaceFolderData | undefined, config: unknown, section?: string, variableToCommandMap?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<Map<string, string> | undefined> {
const expr = ConfigurationResolverExpression.parse(config);
// Get values for input variables from UI

View File

@ -34,13 +34,13 @@ export interface IConfigurationResolverService {
* @param section For example, 'tasks' or 'debug'. Used for resolving inputs.
* @param variables Aliases for commands.
*/
resolveWithInteractionReplace(folder: IWorkspaceFolderData | undefined, config: any, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<any>;
resolveWithInteractionReplace(folder: IWorkspaceFolderData | undefined, config: unknown, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<any>;
/**
* Similar to resolveWithInteractionReplace, except without the replace. Returns a map of variables and their resolution.
* Keys in the map will be of the format input:variableName or command:variableName.
*/
resolveWithInteraction(folder: IWorkspaceFolderData | undefined, config: any, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<Map<string, string> | undefined>;
resolveWithInteraction(folder: IWorkspaceFolderData | undefined, config: unknown, section?: string, variables?: IStringDictionary<string>, target?: ConfigurationTarget): Promise<Map<string, string> | undefined>;
/**
* Contributes a variable that can be resolved later. Consumers that use resolveAny, resolveWithInteraction,

View File

@ -360,7 +360,7 @@ export class ThemeConfiguration {
return ConfigurationTarget.USER;
}
private async writeConfiguration(key: string, value: any, settingsTarget: ThemeSettingTarget): Promise<void> {
private async writeConfiguration(key: string, value: unknown, settingsTarget: ThemeSettingTarget): Promise<void> {
if (settingsTarget === undefined || settingsTarget === 'preview') {
return;
}