提交 197a916f 编写于 作者: M Matt Bierner

Fixing some strict null errors in mainThread

上级 ffe09d36
......@@ -20,6 +20,6 @@ export class MainThreadCommands implements MainThreadClipboardShape {
$writeText(value: string): Promise<void> {
clipboard.writeText(value);
return undefined;
return Promise.resolve();
}
}
......@@ -64,13 +64,14 @@ export class MainThreadCommands implements MainThreadCommandsShape {
}
$unregisterCommand(id: string): void {
if (this._disposables.has(id)) {
this._disposables.get(id).dispose();
const command = this._disposables.get(id);
if (command) {
command.dispose();
this._disposables.delete(id);
}
}
$executeCommand<T>(id: string, args: any[]): Promise<T> {
$executeCommand<T>(id: string, args: any[]): Promise<T | undefined> {
for (let i = 0; i < args.length; i++) {
args[i] = revive(args[i], 0);
}
......
......@@ -44,7 +44,11 @@ export class MainThreadFileSystem implements MainThreadFileSystemShape {
}
$onFileSystemChange(handle: number, changes: IFileChangeDto[]): void {
this._fileProvider.get(handle).$onFileSystemChange(changes);
const fileProvider = this._fileProvider.get(handle);
if (!fileProvider) {
throw new Error('Unknown file provider');
}
fileProvider.$onFileSystemChange(changes);
}
}
......
......@@ -52,7 +52,7 @@ export class MainThreadFileSystemEventService {
// file operation events - (changes the editor makes)
fileService.onAfterOperation(e => {
if (e.operation === FileOperation.MOVE) {
proxy.$onFileRename(e.resource, e.target.resource);
proxy.$onFileRename(e.resource, e.target.resource!);
}
}, undefined, this._listener);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册