Skip to content

Fix access modifier information handover between CDP and DAP for public members #1331

Closed

Description

Depending on the access modifier of a property it should either have a different icon (VS) or different ink (Browser). We implemented object members' grouping by access modifiers in Wasm Debugger (dotnet/runtime#62627) into:
result
internalProperties
privateProperties.
Thanks to that, in Browser we can see:
image

However, VS still does not respect the grouping for public members and displays:
image

We are dropping the information about the grouping between CDP and DAP messages. CDP contains the correct grouping but DAP mixes the information up for the public. It claims that public member is private. It recognizes private and internal/protected groups correctly.

{
   "tag":"cdp.receive",
   "timestamp":1657630024842,
   "metadata":{
      "connectionId":0,
      "message":{
         "id":1030,
         "sessionId":"96A2541DCEEFD7DF5CC4C0C1873DFF5B",
         "result":{
            "result":[
               {
                  "value":{
                     "type":"string",
                     "value":"different",
                     "description":"different"
                  },
                  "writable":false,
                  "isOwn":true,
                  "name":"publicMember"
               }
            ],
            "internalProperties":[
               {
                  "value":{
                     "type":"string",
                     "value":"and different here",
                     "description":"and different here"
                  },
                  "writable":false,
                  "isOwn":true,
                  "name":"protectedMember"
               }
            ],
            "privateProperties":[
               {
                  "value":{
                     "type":"number",
                     "value":0,
                     "description":"0"
                  },
                  "writable":true,
                  "isOwn":true,
                  "name":"privateMember"
               }
            ]
         }
      }
   },
   "level":0
}

DAP:

{
   "tag":"dap.send",
   "timestamp":1657630024854,
   "metadata":{
      "connectionId":1,
      "message":{
         "seq":80,
         "type":"response",
         "request_seq":14,
         "command":"variables",
         "success":true,
         "body":{
            "variables":[
               {
                  "name":"privateMember",
                  "value":"0",
                  "evaluateName":".privateMember",
                  "type":"number",
                  "variablesReference":0,
                  "presentationHint":{
                     "visibility":"private"
                  }
               },
               {
                  "name":"publicMember",
                  "value":"'different'",
                  "evaluateName":".publicMember",
                  "type":"string",
                  "variablesReference":0,
                  "presentationHint":{
                     "visibility":"private"
                  }
               },
               {
                  "name":"protectedMember",
                  "value":"'and different here'",
                  "evaluateName":".protectedMember",
                  "type":"string",
                  "variablesReference":0,
                  "presentationHint":{
                     "visibility":"internal"
                  }
               }
            ]
         }
      }
   },
   "level":0
}

Activity

  1. added a commit that references this issue on Dec 15, 2022
    5d320ee
  2. added a commit that references this issue on Dec 16, 2022
    cbed3af
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

bugIssue identified by VS Code Team member as probable bug

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions