Skip to content

Commit ff6d604

Browse files
committed
Fix or supress more implict index access errors
For microsoft#76442
1 parent ca7605f commit ff6d604

8 files changed

Lines changed: 15 additions & 15 deletions

File tree

src/vs/base/common/worker/simpleWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -212,12 +212,12 @@ export class SimpleWorkerClient<W extends object, H extends object> extends Disp
212212
this._worker.postMessage(msg);
213213
},
214214
handleMessage: (method: string, args: any[]): Promise<any> => {
215-
if (typeof host[method] !== 'function') {
215+
if (typeof (host as any)[method] !== 'function') {
216216
return Promise.reject(new Error('Missing method ' + method + ' on main thread host.'));
217217
}
218218

219219
try {
220-
return Promise.resolve(host[method].apply(host, args));
220+
return Promise.resolve((host as any)[method].apply(host, args));
221221
} catch (e) {
222222
return Promise.reject(e);
223223
}

src/vs/code/electron-browser/issue/issueReporterMain.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ export class IssueReporter extends Disposable {
336336
this.render();
337337
});
338338

339-
['includeSystemInfo', 'includeProcessInfo', 'includeWorkspaceInfo', 'includeExtensions', 'includeSearchedExtensions', 'includeSettingsSearchDetails'].forEach(elementId => {
339+
(['includeSystemInfo', 'includeProcessInfo', 'includeWorkspaceInfo', 'includeExtensions', 'includeSearchedExtensions', 'includeSettingsSearchDetails'] as const).forEach(elementId => {
340340
this.addEventListener(elementId, 'click', (event: Event) => {
341341
event.stopPropagation();
342342
this.issueReporterModel.update({ [elementId]: !this.issueReporterModel.getData()[elementId] });

src/vs/editor/common/services/webWorker.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,13 +52,13 @@ export interface IWebWorkerOptions {
5252
/**
5353
* An object that can be used by the web worker to make calls back to the main thread.
5454
*/
55-
host?: object;
55+
host?: any;
5656
}
5757

5858
class MonacoWebWorkerImpl<T> extends EditorWorkerClient implements MonacoWebWorker<T> {
5959

6060
private readonly _foreignModuleId: string;
61-
private readonly _foreignModuleHost: object | null;
61+
private readonly _foreignModuleHost: { [method: string]: Function } | null;
6262
private _foreignModuleCreateData: any | null;
6363
private _foreignProxy: Promise<T> | null;
6464

src/vs/monaco.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -989,7 +989,7 @@ declare namespace monaco.editor {
989989
/**
990990
* An object that can be used by the web worker to make calls back to the main thread.
991991
*/
992-
host?: object;
992+
host?: any;
993993
}
994994

995995
/**

src/vs/platform/instantiation/common/instantiationService.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,10 +222,10 @@ export class InstantiationService implements IInstantiationService {
222222
const idle = new IdleValue(() => this._createInstance<T>(ctor, args, _trace));
223223
return <T>new Proxy(Object.create(null), {
224224
get(_target: T, prop: PropertyKey): any {
225-
return idle.getValue()[prop];
225+
return (idle.getValue() as any)[prop];
226226
},
227227
set(_target: T, p: PropertyKey, value: any): boolean {
228-
idle.getValue()[p] = value;
228+
(idle.getValue() as any)[p] = value;
229229
return true;
230230
}
231231
});

src/vs/workbench/contrib/comments/browser/commentsEditorContribution.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export class ReviewController implements IEditorContribution {
163163
private _emptyThreadsToAddQueue: [number, IEditorMouseEvent | undefined][] = [];
164164
private _computeCommentingRangePromise: CancelablePromise<ICommentInfo[]> | null;
165165
private _computeCommentingRangeScheduler: Delayer<Array<ICommentInfo | null>> | null;
166-
private _pendingCommentCache: { [key: number]: { [key: string]: string } };
166+
private _pendingCommentCache: { [key: string]: { [key: string]: string } };
167167

168168
constructor(
169169
editor: ICodeEditor,
@@ -396,7 +396,7 @@ export class ReviewController implements IEditorContribution {
396396
return;
397397
}
398398

399-
const pendingCommentText = this._pendingCommentCache[e.owner] && this._pendingCommentCache[e.owner][thread.threadId];
399+
const pendingCommentText = this._pendingCommentCache[e.owner] && this._pendingCommentCache[e.owner][thread.threadId!];
400400
this.displayCommentThread(e.owner, thread, pendingCommentText);
401401
this._commentInfos.filter(info => info.owner === e.owner)[0].threads.push(thread);
402402
});
@@ -624,7 +624,7 @@ export class ReviewController implements IEditorContribution {
624624
info.threads.forEach(thread => {
625625
let pendingComment: string | null = null;
626626
if (providerCacheStore) {
627-
pendingComment = providerCacheStore[thread.threadId];
627+
pendingComment = providerCacheStore[thread.threadId!];
628628
}
629629

630630
if (pendingComment) {
@@ -658,10 +658,10 @@ export class ReviewController implements IEditorContribution {
658658
this._pendingCommentCache[zone.owner] = {};
659659
}
660660

661-
this._pendingCommentCache[zone.owner][zone.commentThread.threadId] = pendingComment;
661+
this._pendingCommentCache[zone.owner][zone.commentThread.threadId!] = pendingComment;
662662
} else {
663663
if (providerCacheStore) {
664-
delete providerCacheStore[zone.commentThread.threadId];
664+
delete providerCacheStore[zone.commentThread.threadId!];
665665
}
666666
}
667667

src/vs/workbench/contrib/experiments/electron-browser/experimentService.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ export class ExperimentService extends Disposable implements IExperimentService
179179
if (context.res.statusCode !== 200) {
180180
return Promise.resolve(null);
181181
}
182-
return asJson(context).then(result => {
182+
return asJson(context).then((result: any) => {
183183
return result && Array.isArray(result['experiments']) ? result['experiments'] : [];
184184
});
185185
}, () => Promise.resolve(null));

src/vs/workbench/services/extensions/common/extensionsRegistry.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -206,7 +206,7 @@ export const schema = {
206206
type: 'object',
207207
properties: {
208208
// extensions will fill in
209-
},
209+
} as { [key: string]: any },
210210
default: {}
211211
},
212212
preview: {

0 commit comments

Comments
 (0)