microsoft / microsoft/debug-adapter-protocol

GotoTargetsArguments should have thread id

Open
#38 3 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

feature-request
Dominant language
HTML
Stars
1.8k
Forks
173
Avg merge
7d 7h
Merged PRs (30d)
2

Description

Currently GotoTargetsArguments provides only source, line, and column. This is not enough to identify if a given line is valid for the user to move there. It should have threadId as an argument. This will allow the debugger to validate.

# test.py
def foo():
    print('A')  # suppose thread 2 is stopped here

def bar():
    print('B')  # suppose thread 1 is stopped here
    print('C')

It is valid for thread 1 to move within the same block to print('C'). It is not valid for thread 2 to move to print('C'). There is no way to tell which thread the user wants to move from the arguments of gotoTargets request. The goto request will fail for thread 2, but this can be avoided.

For the screenshot below, I forced a blank targets response. This allows IDE to show changes to cursor indicating the move invalid
image

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the GotoTargetsArguments definition and the gotoTargets request in the debug adapter protocol. Trace how the request is validated and handled, then confirm that the protocol can identify the originating thread and reject invalid move targets without relying on a later goto failure.

Written by the indexing model from the issue text.

Assessment

Domain
api, devtools
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.