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

@@ -18,6 +18,7 @@ import { ILogService } from 'vs/platform/log/common/log';
import { CancellationToken } from 'vs/base/common/cancellation';
import { ExtensionIdentifier, IExtensionDescription } from 'vs/platform/extensions/common/extensions';
import { checkProposedApiEnabled } from 'vs/workbench/services/extensions/common/extensions';
import { MarshalledId } from 'vs/base/common/marshalling';
type ProviderHandle = number;
type GroupHandle = number;
@@ -660,7 +661,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
_commands.registerArgumentProcessor({
processArgument: arg => {
if (arg && arg.$mid === 3) {
if (arg && arg.$mid === MarshalledId.ScmResource) {
const sourceControl = this._sourceControls.get(arg.sourceControlHandle);
if (!sourceControl) {
@@ -674,7 +675,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
}
return group.getResourceState(arg.handle);
} else if (arg && arg.$mid === 4) {
} else if (arg && arg.$mid === MarshalledId.ScmResourceGroup) {
const sourceControl = this._sourceControls.get(arg.sourceControlHandle);
if (!sourceControl) {
@@ -682,7 +683,7 @@ export class ExtHostSCM implements ExtHostSCMShape {
}
return sourceControl.getResourceGroup(arg.groupHandle);
} else if (arg && arg.$mid === 5) {
} else if (arg && arg.$mid === MarshalledId.ScmProvider) {
const sourceControl = this._sourceControls.get(arg.handle);
if (!sourceControl) {