Skip to content

Add breakpoint context action: Jump To Line #204526

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

xiaoyun94
Copy link
Contributor

image

@roblourens
Copy link
Member

Can you tell me more?

@xiaoyun94
Copy link
Contributor Author

Can you tell me more?

Editor Context Menu Items:
image

Breakpoint Context Menu Items now:
image

The reason why add an action into breakpoint context menu is that i installed too many extensions. so threre about 20+ editor context menu actions(shortcut shows my home pc rather than working use)
Editor Conext Menu is easy to be effected by other extensions, but breakpoint Context Menu is limited to be modified.

@roblourens
Copy link
Member

I see, I actually wasn't familiar with that command. It probably makes sense to have it where Run to Line appears.

Does this work though? Doesn't it need to do all the other code after gotoTargets that

const targets = response?.body.targets;
if (targets && targets.length) {
let id = targets[0].id;
if (targets.length > 1) {
const picks = targets.map(t => ({ label: t.label, _id: t.id }));
const pick = await quickInputService.pick(picks, { placeHolder: nls.localize('chooseLocation', "Choose the specific location") });
if (!pick) {
return;
}
id = pick._id;
}
return await stackFrame.thread.session.goto(stackFrame.thread.threadId, id).catch(e => notificationService.warn(e));
does?

@xiaoyun94
Copy link
Contributor Author

我明白了,我实际上并不熟悉这个命令。将它放在 Run to Line 出现的地方可能是有意义的。

不过,这行得通吗?在那之后它不需要做所有其他代码吗gotoTargets

const targets = response?.body.targets;
if (targets && targets.length) {
let id = targets[0].id;
if (targets.length > 1) {
const picks = targets.map(t => ({ label: t.label, _id: t.id }));
const pick = await quickInputService.pick(picks, { placeHolder: nls.localize('chooseLocation', "Choose the specific location") });
if (!pick) {
return;
}
id = pick._id;
}
return await stackFrame.thread.session.goto(stackFrame.thread.threadId, id).catch(e => notificationService.warn(e));

does?

i have tested in my code server. it works.
Jump to Cursor : may find 2 or more targets due to multi cursors, so it must ask user to choose one.
but Jump to Line here set collom is 0 column at expected line, the cursor is unique, so there is no need to choose.

@roblourens roblourens added this to the March 2024 milestone Feb 19, 2024
@roblourens
Copy link
Member

I don't think that gotoTargets is expected to have a side effect. If it works, I wonder whether the DA is doing the wrong thing for that request. The description of the request is This request retrieves the possible goto targets for the specified source location.. I will test it next week.

@xiaoyun94
Copy link
Contributor Author

@roblourens Are you making progress?

@roblourens roblourens modified the milestones: March 2024, April 2024 Mar 26, 2024
@roblourens
Copy link
Member

Sorry, it's been a busy time but I will get to it

@roblourens roblourens modified the milestones: April 2024, May 2024 Apr 24, 2024
@roblourens roblourens modified the milestones: May 2024, June 2024 May 29, 2024
@roblourens roblourens modified the milestones: June 2024, July 2024 Jun 25, 2024
@roblourens roblourens modified the milestones: July 2024, August 2024 Jul 24, 2024
@roblourens
Copy link
Member

Which debugger are you using to test this? I don't see how this can work without calling session.goto, if the DA does the right thing. I think gotoTargets should only retrieve a list of targets.

@roblourens roblourens removed this from the August 2024 milestone Jul 26, 2024
@xiaoyun94
Copy link
Contributor Author

xiaoyun94 commented Aug 7, 2024

Which debugger are you using to test this? I don't see how this can work without calling session.goto, if the DA does the right thing. I think gotoTargets should only retrieve a list of targets.

I use Native Debug as C program Debuger, and it works well @roblourens

@vivodi
Copy link

vivodi commented Dec 29, 2024

Is this still relevant?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants