protocol: refactor to use enum for marshalled object ids

This commit is contained in:
Connor Peet
2021-06-22 14:11:14 -07:00
parent a655162147
commit 751f8729dc
16 changed files with 65 additions and 35 deletions

View File

@@ -23,6 +23,7 @@ import { ViewPaneContainer } from 'vs/workbench/browser/parts/views/viewPaneCont
import { Codicon } from 'vs/base/common/codicons';
import { registerIcon } from 'vs/platform/theme/common/iconRegistry';
import { localize } from 'vs/nls';
import { MarshalledId } from 'vs/base/common/marshalling';
export class MainThreadCommentThread implements modes.CommentThread {
@@ -154,7 +155,7 @@ export class MainThreadCommentThread implements modes.CommentThread {
toJSON(): any {
return {
$mid: 7,
$mid: MarshalledId.CommentThread,
commentControlHandle: this.controllerHandle,
commentThreadHandle: this.commentThreadHandle,
};
@@ -347,7 +348,7 @@ export class MainThreadCommentController {
toJSON(): any {
return {
$mid: 6,
$mid: MarshalledId.CommentController,
handle: this.handle
};
}

View File

@@ -12,6 +12,7 @@ import { Command } from 'vs/editor/common/modes';
import { extHostNamedCustomer } from 'vs/workbench/api/common/extHostCustomers';
import { ISplice, Sequence } from 'vs/base/common/sequence';
import { CancellationToken } from 'vs/base/common/cancellation';
import { MarshalledId } from 'vs/base/common/marshalling';
class MainThreadSCMResourceGroup implements ISCMResourceGroup {
@@ -36,7 +37,7 @@ class MainThreadSCMResourceGroup implements ISCMResourceGroup {
toJSON(): any {
return {
$mid: 4,
$mid: MarshalledId.ScmResourceGroup,
sourceControlHandle: this.sourceControlHandle,
groupHandle: this.handle
};
@@ -78,7 +79,7 @@ class MainThreadSCMResource implements ISCMResource {
toJSON(): any {
return {
$mid: 3,
$mid: MarshalledId.ScmResource,
sourceControlHandle: this.sourceControlHandle,
groupHandle: this.groupHandle,
handle: this.handle
@@ -256,7 +257,7 @@ class MainThreadSCMProvider implements ISCMProvider {
toJSON(): any {
return {
$mid: 5,
$mid: MarshalledId.ScmProvider,
handle: this.handle
};
}