diff --git a/src/adapters/customVariables/ifGetMessagePort.ts b/src/adapters/customVariables/ifGetMessagePort.ts index 50cea674..5f104430 100644 --- a/src/adapters/customVariables/ifGetMessagePort.ts +++ b/src/adapters/customVariables/ifGetMessagePort.ts @@ -6,8 +6,8 @@ import { pushCustomVariableToContainer } from './utils'; export function pushIfGetMessagePortVariables(adapter: DebugProtocolAdapter, expression: string, container: EvaluateContainer) { pushCustomVariableToContainer(adapter, container, { name: '$messagePort', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetMessagePort()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifImageMetadata.ts b/src/adapters/customVariables/ifImageMetadata.ts index 7b288daa..355c0941 100644 --- a/src/adapters/customVariables/ifImageMetadata.ts +++ b/src/adapters/customVariables/ifImageMetadata.ts @@ -6,8 +6,8 @@ import { pushCustomVariableToContainer } from './utils'; export function pushIfImageMetadataVariables(adapter: DebugProtocolAdapter, expression: string, container: EvaluateContainer) { pushCustomVariableToContainer(adapter, container, { name: '$metadata', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetMetadata()`, value: '', children: [] @@ -15,8 +15,8 @@ export function pushIfImageMetadataVariables(adapter: DebugProtocolAdapter, expr pushCustomVariableToContainer(adapter, container, { name: '$thumbnail', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetThumbnail()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifRegion.ts b/src/adapters/customVariables/ifRegion.ts index 38ba45b6..ebeacabe 100644 --- a/src/adapters/customVariables/ifRegion.ts +++ b/src/adapters/customVariables/ifRegion.ts @@ -6,8 +6,8 @@ import { pushCustomVariableToContainer } from './utils'; export function pushIfRegionVariables(adapter: DebugProtocolAdapter, expression: string, container: EvaluateContainer) { pushCustomVariableToContainer(adapter, container, { name: '$bitmap', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetBitmap()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifSGNodeChildren.ts b/src/adapters/customVariables/ifSGNodeChildren.ts index 34074b4c..77f3fdaf 100644 --- a/src/adapters/customVariables/ifSGNodeChildren.ts +++ b/src/adapters/customVariables/ifSGNodeChildren.ts @@ -33,7 +33,7 @@ export function pushIfSGNodeChildrenVariables(adapter: DebugProtocolAdapter, exp pushCustomVariableToContainer(adapter, container, { name: '$scene', type: VariableType.SubtypedObject, - presentationHint: { kind: 'virtual', lazy: true }, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.getScene()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifSGNodeField.ts b/src/adapters/customVariables/ifSGNodeField.ts index b7f7c3ef..258e3140 100644 --- a/src/adapters/customVariables/ifSGNodeField.ts +++ b/src/adapters/customVariables/ifSGNodeField.ts @@ -16,7 +16,7 @@ export function pushIfSGNodeFieldVariables(adapter: DebugProtocolAdapter, expres pushCustomVariableToContainer(adapter, container, { name: '$threadInfo', type: VariableType.AssociativeArray, - presentationHint: { kind: 'virtual', lazy: true }, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.threadInfo()`, value: VariableType.AssociativeArray, children: [] diff --git a/src/adapters/customVariables/ifSGNodeHttpAgentAccess.ts b/src/adapters/customVariables/ifSGNodeHttpAgentAccess.ts index 49b02afd..0e7eee89 100644 --- a/src/adapters/customVariables/ifSGNodeHttpAgentAccess.ts +++ b/src/adapters/customVariables/ifSGNodeHttpAgentAccess.ts @@ -6,8 +6,8 @@ import { pushCustomVariableToContainer } from './utils'; export function pushIfSGNodeHttpAgentAccessVariables(adapter: DebugProtocolAdapter, expression: string, container: EvaluateContainer) { pushCustomVariableToContainer(adapter, container, { name: '$httpAgent', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.getHttpAgent()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifSGScreen.ts b/src/adapters/customVariables/ifSGScreen.ts index cd93ec2d..4f2308a4 100644 --- a/src/adapters/customVariables/ifSGScreen.ts +++ b/src/adapters/customVariables/ifSGScreen.ts @@ -6,8 +6,8 @@ import { pushCustomVariableToContainer } from './utils'; export function pushIfSGScreenVariables(adapter: DebugProtocolAdapter, expression: string, container: EvaluateContainer) { pushCustomVariableToContainer(adapter, container, { name: '$messagePort', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetMessagePort()`, value: '', children: [] @@ -24,7 +24,7 @@ export function pushIfSGScreenVariables(adapter: DebugProtocolAdapter, expressio pushCustomVariableToContainer(adapter, container, { name: '$scene', - type: VariableType.Object, + type: VariableType.SubtypedObject, presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetScene()`, value: '', diff --git a/src/adapters/customVariables/ifSocket.ts b/src/adapters/customVariables/ifSocket.ts index 5776d935..37e85429 100644 --- a/src/adapters/customVariables/ifSocket.ts +++ b/src/adapters/customVariables/ifSocket.ts @@ -6,8 +6,8 @@ import { pushCustomVariableToContainer } from './utils'; export function pushIfSocketVariables(adapter: DebugProtocolAdapter, expression: string, container: EvaluateContainer) { pushCustomVariableToContainer(adapter, container, { name: '$address', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetAddress()`, value: '', children: [] @@ -15,8 +15,8 @@ export function pushIfSocketVariables(adapter: DebugProtocolAdapter, expression: pushCustomVariableToContainer(adapter, container, { name: '$sendToAddress', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetSendToAddress()`, value: '', children: [] @@ -24,8 +24,8 @@ export function pushIfSocketVariables(adapter: DebugProtocolAdapter, expression: pushCustomVariableToContainer(adapter, container, { name: '$receivedFromAddress', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetReceivedFromAddress()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifSprite.ts b/src/adapters/customVariables/ifSprite.ts index 392587fd..2aacde9f 100644 --- a/src/adapters/customVariables/ifSprite.ts +++ b/src/adapters/customVariables/ifSprite.ts @@ -60,8 +60,8 @@ export function pushIfSpriteVariables(adapter: DebugProtocolAdapter, expression: pushCustomVariableToContainer(adapter, container, { name: '$region', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetRegion()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifVideoPlayer.ts b/src/adapters/customVariables/ifVideoPlayer.ts index 61637d9b..280cd75c 100644 --- a/src/adapters/customVariables/ifVideoPlayer.ts +++ b/src/adapters/customVariables/ifVideoPlayer.ts @@ -24,8 +24,8 @@ export function pushIfVideoPlayerVariables(adapter: DebugProtocolAdapter, expres pushCustomVariableToContainer(adapter, container, { name: '$captionRenderer', - type: 'roCaptionRenderer', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.Object, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetCaptionRenderer()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifXMLElement.ts b/src/adapters/customVariables/ifXMLElement.ts index 7b19ae78..53436b57 100644 --- a/src/adapters/customVariables/ifXMLElement.ts +++ b/src/adapters/customVariables/ifXMLElement.ts @@ -42,8 +42,8 @@ export function pushIfXMLElementVariables(adapter: DebugProtocolAdapter, express pushCustomVariableToContainer(adapter, container, { name: '$childElements', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.List, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetChildElements()`, value: '', children: [] @@ -51,8 +51,8 @@ export function pushIfXMLElementVariables(adapter: DebugProtocolAdapter, express pushCustomVariableToContainer(adapter, container, { name: '$childNodes', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.List, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetChildNodes()`, value: '', children: [] diff --git a/src/adapters/customVariables/ifXMLList.ts b/src/adapters/customVariables/ifXMLList.ts index 5ac240ba..8cd6cd82 100644 --- a/src/adapters/customVariables/ifXMLList.ts +++ b/src/adapters/customVariables/ifXMLList.ts @@ -6,8 +6,8 @@ import { pushCustomVariableToContainer } from './utils'; export function pushIfXMLListVariables(adapter: DebugProtocolAdapter, expression: string, container: EvaluateContainer) { pushCustomVariableToContainer(adapter, container, { name: '$attributes', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.List, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetAttributes()`, value: '', children: [] @@ -24,8 +24,8 @@ export function pushIfXMLListVariables(adapter: DebugProtocolAdapter, expression pushCustomVariableToContainer(adapter, container, { name: '$childElements', - type: '', - presentationHint: { kind: 'virtual', lazy: true }, + type: VariableType.List, + presentationHint: { kind: 'virtual' }, evaluateName: `${expression}.GetChildElements()`, value: '', children: [] diff --git a/src/debugSession/BrightScriptDebugSession.ts b/src/debugSession/BrightScriptDebugSession.ts index cc2fc009..2d74836d 100644 --- a/src/debugSession/BrightScriptDebugSession.ts +++ b/src/debugSession/BrightScriptDebugSession.ts @@ -1438,8 +1438,10 @@ export class BrightScriptDebugSession extends BaseDebugSession { } } + // Only send the updated variables if we are not going to trigger an invalidated event. + // This is to prevent the UI from updating twice and makes the experience much smoother to the end user. response.body = { - variables: this.filterVariablesUpdates(updatedVariables, args, this.variables[args.variablesReference]) + variables: sendInvalidatedEvent ? [] : this.filterVariablesUpdates(updatedVariables, args, this.variables[args.variablesReference]) }; } catch (error) { logger.error('Error during variablesRequest', error, { args });