提交 d7bb4b5a 编写于 作者: J Johannes Rieken

more native json, #40169

上级 426a39d7
...@@ -452,7 +452,7 @@ export interface ExtHostDocumentsShape { ...@@ -452,7 +452,7 @@ export interface ExtHostDocumentsShape {
} }
export interface ExtHostDocumentSaveParticipantShape { export interface ExtHostDocumentSaveParticipantShape {
$participateInSave(resource: URI, reason: SaveReason): Thenable<boolean[]>; $participateInSave(resource: UriComponents, reason: SaveReason): Thenable<boolean[]>;
} }
export interface ITextEditorAddData { export interface ITextEditorAddData {
...@@ -510,9 +510,9 @@ export interface ExtHostExtensionServiceShape { ...@@ -510,9 +510,9 @@ export interface ExtHostExtensionServiceShape {
} }
export interface FileSystemEvents { export interface FileSystemEvents {
created: URI[]; created: UriComponents[];
changed: URI[]; changed: UriComponents[];
deleted: URI[]; deleted: UriComponents[];
} }
export interface ExtHostFileSystemEventServiceShape { export interface ExtHostFileSystemEventServiceShape {
$onFileEvent(events: FileSystemEvents): void; $onFileEvent(events: FileSystemEvents): void;
...@@ -686,7 +686,7 @@ export const MainContext = { ...@@ -686,7 +686,7 @@ export const MainContext = {
MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'), MainThreadStorage: createMainId<MainThreadStorageShape>('MainThreadStorage'),
MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'), MainThreadTelemetry: createMainId<MainThreadTelemetryShape>('MainThreadTelemetry'),
MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'), MainThreadTerminalService: createMainId<MainThreadTerminalServiceShape>('MainThreadTerminalService'),
MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace'), MainThreadWorkspace: createMainId<MainThreadWorkspaceShape>('MainThreadWorkspace', ProxyType.CustomMarshaller),
MainThreadFileSystem: createMainId<MainThreadFileSystemShape>('MainThreadFileSystem'), MainThreadFileSystem: createMainId<MainThreadFileSystemShape>('MainThreadFileSystem'),
MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'), MainThreadExtensionService: createMainId<MainThreadExtensionServiceShape>('MainThreadExtensionService'),
MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', ProxyType.CustomMarshaller), MainThreadSCM: createMainId<MainThreadSCMShape>('MainThreadSCM', ProxyType.CustomMarshaller),
...@@ -703,11 +703,11 @@ export const ExtHostContext = { ...@@ -703,11 +703,11 @@ export const ExtHostContext = {
ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ProxyType.CustomMarshaller), ExtHostDocumentsAndEditors: createExtId<ExtHostDocumentsAndEditorsShape>('ExtHostDocumentsAndEditors', ProxyType.CustomMarshaller),
ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments'), ExtHostDocuments: createExtId<ExtHostDocumentsShape>('ExtHostDocuments'),
ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders'), ExtHostDocumentContentProviders: createExtId<ExtHostDocumentContentProvidersShape>('ExtHostDocumentContentProviders'),
ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant', ProxyType.CustomMarshaller), ExtHostDocumentSaveParticipant: createExtId<ExtHostDocumentSaveParticipantShape>('ExtHostDocumentSaveParticipant'),
ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ProxyType.CustomMarshaller), ExtHostEditors: createExtId<ExtHostEditorsShape>('ExtHostEditors', ProxyType.CustomMarshaller),
ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews'), ExtHostTreeViews: createExtId<ExtHostTreeViewsShape>('ExtHostTreeViews'),
ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem', ProxyType.CustomMarshaller), ExtHostFileSystem: createExtId<ExtHostFileSystemShape>('ExtHostFileSystem', ProxyType.CustomMarshaller),
ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService', ProxyType.CustomMarshaller), ExtHostFileSystemEventService: createExtId<ExtHostFileSystemEventServiceShape>('ExtHostFileSystemEventService'),
ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor'), ExtHostHeapService: createExtId<ExtHostHeapServiceShape>('ExtHostHeapMonitor'),
ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ProxyType.CustomMarshaller), ExtHostLanguageFeatures: createExtId<ExtHostLanguageFeaturesShape>('ExtHostLanguageFeatures', ProxyType.CustomMarshaller),
ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen'), ExtHostQuickOpen: createExtId<ExtHostQuickOpenShape>('ExtHostQuickOpen'),
......
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
'use strict'; 'use strict';
import Event from 'vs/base/common/event'; import Event from 'vs/base/common/event';
import URI from 'vs/base/common/uri'; import URI, { UriComponents } from 'vs/base/common/uri';
import { sequence, always } from 'vs/base/common/async'; import { sequence, always } from 'vs/base/common/async';
import { illegalState } from 'vs/base/common/errors'; import { illegalState } from 'vs/base/common/errors';
import { ExtHostDocumentSaveParticipantShape, MainThreadEditorsShape, IWorkspaceResourceEdit } from 'vs/workbench/api/node/extHost.protocol'; import { ExtHostDocumentSaveParticipantShape, MainThreadEditorsShape, IWorkspaceResourceEdit } from 'vs/workbench/api/node/extHost.protocol';
...@@ -49,7 +49,8 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic ...@@ -49,7 +49,8 @@ export class ExtHostDocumentSaveParticipant implements ExtHostDocumentSavePartic
}; };
} }
$participateInSave(resource: URI, reason: SaveReason): Thenable<boolean[]> { $participateInSave(data: UriComponents, reason: SaveReason): Thenable<boolean[]> {
const resource = URI.revive(data);
const entries = this._callbacks.toArray(); const entries = this._callbacks.toArray();
let didTimeout = false; let didTimeout = false;
......
...@@ -9,6 +9,7 @@ import { Disposable } from './extHostTypes'; ...@@ -9,6 +9,7 @@ import { Disposable } from './extHostTypes';
import { parse, IRelativePattern } from 'vs/base/common/glob'; import { parse, IRelativePattern } from 'vs/base/common/glob';
import { Uri, FileSystemWatcher as _FileSystemWatcher } from 'vscode'; import { Uri, FileSystemWatcher as _FileSystemWatcher } from 'vscode';
import { FileSystemEvents, ExtHostFileSystemEventServiceShape } from './extHost.protocol'; import { FileSystemEvents, ExtHostFileSystemEventServiceShape } from './extHost.protocol';
import URI from 'vs/base/common/uri';
class FileSystemWatcher implements _FileSystemWatcher { class FileSystemWatcher implements _FileSystemWatcher {
...@@ -48,22 +49,25 @@ class FileSystemWatcher implements _FileSystemWatcher { ...@@ -48,22 +49,25 @@ class FileSystemWatcher implements _FileSystemWatcher {
let subscription = dispatcher(events => { let subscription = dispatcher(events => {
if (!ignoreCreateEvents) { if (!ignoreCreateEvents) {
for (let created of events.created) { for (let created of events.created) {
if (parsedPattern(created.fsPath)) { let uri = URI.revive(created);
this._onDidCreate.fire(created); if (parsedPattern(uri.fsPath)) {
this._onDidCreate.fire(uri);
} }
} }
} }
if (!ignoreChangeEvents) { if (!ignoreChangeEvents) {
for (let changed of events.changed) { for (let changed of events.changed) {
if (parsedPattern(changed.fsPath)) { let uri = URI.revive(changed);
this._onDidChange.fire(changed); if (parsedPattern(uri.fsPath)) {
this._onDidChange.fire(uri);
} }
} }
} }
if (!ignoreDeleteEvents) { if (!ignoreDeleteEvents) {
for (let deleted of events.deleted) { for (let deleted of events.deleted) {
if (parsedPattern(deleted.fsPath)) { let uri = URI.revive(deleted);
this._onDidDelete.fire(deleted); if (parsedPattern(uri.fsPath)) {
this._onDidDelete.fire(uri);
} }
} }
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册