Skip to content
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

Weird breakpoint setting behaviour #42485

Closed
jrieken opened this issue Jan 30, 2018 · 2 comments
Closed

Weird breakpoint setting behaviour #42485

jrieken opened this issue Jan 30, 2018 · 2 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Milestone

Comments

@jrieken
Copy link
Member

jrieken commented Jan 30, 2018

re #42321

Take the extension snippet below and in the debuggee have a file with the content below. Then do

  • open the files
  • put cursor at the start of line fours
  • invoke the command -> see three breakpoints on lines 4, 5, 6
  • remove all breakpoints, move cursor onto line 5, invoke command again
  • 🐛 no editor annotation appears, breaks are listed in the debug view
 vscode.commands.registerCommand('extension.sayHello', () => {

        if (vscode.window.activeTextEditor) {

            const { selection, document } = vscode.window.activeTextEditor;

            vscode.debug.addBreakpoints([
                new vscode.SourceBreakpoint(new vscode.Location(document.uri, selection.with(selection.start.translate(2), selection.start.translate(2)))),
                new vscode.SourceBreakpoint(new vscode.Location(document.uri, selection.with(selection.start.translate(1), selection.start.translate(1)))),
                new vscode.SourceBreakpoint(new vscode.Location(document.uri, selection.with(selection.start.translate(0), selection.start.translate(0)))),
            ]);
        }
});

(notice two empty lines at the bottom)

42
line 2
3,9,27
vier


jan-30-2018 15-28-11

@weinand weinand added debug Debug viewlet, configurations, breakpoints, adapter issues bug Issue identified by VS Code Team member as probable bug labels Jan 31, 2018
@weinand weinand added this to the January 2018 milestone Jan 31, 2018
@weinand
Copy link
Contributor

weinand commented Jan 31, 2018

@isidorn I can reproduce (even if line 5 and 6 are not empty).
Since Breakpoints are not verified (and you show them anyway in the Breakpoints view), I would expect that all breakpoints with valid location are shown in the gutter.

@weinand weinand assigned isidorn and unassigned weinand Jan 31, 2018
@isidorn
Copy link
Contributor

isidorn commented Feb 1, 2018

Nice catch. The issue was that my breakpoint decorations were breaking because I went to the editor model to get the max column for an nonexistent line. In this case line 7.
Now I added a simple check if the line number is within range, if not I do not show it.

@isidorn isidorn closed this as completed in b919e2f Feb 1, 2018
@weinand weinand added the verified Verification succeeded label Feb 2, 2018
@vscodebot vscodebot bot locked and limited conversation to collaborators Mar 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug debug Debug viewlet, configurations, breakpoints, adapter issues verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

3 participants