提交 b64355bf 编写于 作者: A Alex Dima

Remove usage of CustomMarshaller for MainThreadDocuments (#40169)

上级 1ec2438d
......@@ -4,7 +4,7 @@
*--------------------------------------------------------------------------------------------*/
'use strict';
import URI from 'vs/base/common/uri';
import URI, { UriComponents } from 'vs/base/common/uri';
import { toErrorMessage } from 'vs/base/common/errorMessage';
import { IModelService } from 'vs/editor/common/services/modelService';
import { IDisposable, dispose, IReference } from 'vs/base/common/lifecycle';
......@@ -168,12 +168,12 @@ export class MainThreadDocuments implements MainThreadDocumentsShape {
// --- from extension host process
$trySaveDocument(uri: URI): TPromise<boolean> {
return this._textFileService.save(uri);
$trySaveDocument(uri: UriComponents): TPromise<boolean> {
return this._textFileService.save(URI.revive(uri));
}
$tryOpenDocument(uri: URI): TPromise<any> {
$tryOpenDocument(_uri: UriComponents): TPromise<any> {
const uri = URI.revive(_uri);
if (!uri.scheme || !(uri.fsPath || uri.authority)) {
return TPromise.wrapError(new Error(`Invalid uri. Scheme and authority or path must be set.`));
}
......
......@@ -151,8 +151,8 @@ export interface MainThreadDocumentContentProvidersShape extends IDisposable {
export interface MainThreadDocumentsShape extends IDisposable {
$tryCreateDocument(options?: { language?: string; content?: string; }): TPromise<any>;
$tryOpenDocument(uri: URI): TPromise<any>;
$trySaveDocument(uri: URI): TPromise<boolean>;
$tryOpenDocument(uri: UriComponents): TPromise<any>;
$trySaveDocument(uri: UriComponents): TPromise<boolean>;
}
export interface ISelectionChangeEvent {
......@@ -671,7 +671,7 @@ export const MainContext = {
MainThreadDecorations: createMainId<MainThreadDecorationsShape>('MainThreadDecorations', ProxyType.CustomMarshaller),
MainThreadDiagnostics: createMainId<MainThreadDiagnosticsShape>('MainThreadDiagnostics', ProxyType.CustomMarshaller),
MainThreadDialogs: createMainId<MainThreadDiaglogsShape>('MainThreadDiaglogs', ProxyType.CustomMarshaller),
MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments', ProxyType.CustomMarshaller),
MainThreadDocuments: createMainId<MainThreadDocumentsShape>('MainThreadDocuments'),
MainThreadDocumentContentProviders: createMainId<MainThreadDocumentContentProvidersShape>('MainThreadDocumentContentProviders', ProxyType.CustomMarshaller),
MainThreadEditors: createMainId<MainThreadEditorsShape>('MainThreadEditors'),
MainThreadErrors: createMainId<MainThreadErrorsShape>('MainThreadErrors', ProxyType.CustomMarshaller),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册