microsoft / VSDebugAdapterHost

Visual Studio Debug Adapter Host
MIT License
77 stars 20 forks source link

Visual Studio doesn't follow spec for Scope.presentationHint #12

Closed ben-clayton closed 5 years ago

ben-clayton commented 5 years ago

Unlike a bunch of other fields with the name presentationHint, Scope.presentationHint is an optional string, and is not a PresentationHintValue.

This WARNING suggests the Visual Studio implementation has got this field type wrong:

 1> [DebugAdapter] --> C (scopes-681): {"command":"scopes","arguments":{"frameId":28383},"seq":681,"type":"request"}
 1> [DebugAdapter] <--   R (scopes-681) [0 ms]: {"body":{"scopes":[{"expensive":false,"name":"globals","presentationHint":"globals","source":{"name":"shader","sourceReference":12},"variablesReference":1655556},{"expensive":false,"name":"locals","presentationHint":"locals","source":{"name":"shader","sourceReference":12},"variablesReference":1655580},{"expensive":false,"name":"arguments","presentationHint":"arguments","source":{"name":"shader","sourceReference":12},"variablesReference":1655552},{"expensive":false,"name":"registers","presentationHint":"registers","source":{"name":"shader","sourceReference":12},"variablesReference":1655589}]},"command":"scopes","request_seq":681,"seq":743,"success":true,"type":"response"}
 1> WARNING: Value 'globals' is not valid for field of type 'PresentationHintValue'.

PS: While the ship may have already sailed, have you considered code-generating the underlying VS DAP encoder / decoder from the .json file? I've knocked together a simple golang script to generate a C++ DAP protocol defintion file.

ben-clayton commented 5 years ago

Sorry - I'm being an idiot. globals is not an accepted value in the spec. I mistook PresentationHintValue for the spec's VariablePresentationHint. Closing.