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

Debugging deno code jump to wrong place. #104045

Closed
yubaoquan opened this issue Aug 5, 2020 · 1 comment
Closed

Debugging deno code jump to wrong place. #104045

yubaoquan opened this issue Aug 5, 2020 · 1 comment
Assignees
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues

Comments

@yubaoquan
Copy link

Version: 1.47.3 (user setup)
Commit: 91899dc
Date: 2020-07-23T13:12:49.994Z
Electron: 7.3.2
Chrome: 78.0.3904.130
Node.js: 12.8.1
V8: 7.8.279.23-electron.0
OS: Windows_NT x64 10.0.18362

Steps to Reproduce:

  1. Write ts code with comments;
  2. Debug, use deno to run it;
  3. step over each line;

debug config:

{
 "version": "0.2.0",
  "configurations": [
  {
    "type": "node",
    "request": "launch",
    "name": "Deno",
    "runtimeExecutable": "deno",
    "port": 9229,
    "runtimeArgs": ["run", "--inspect-brk", "-A", "index.ts"],
    "cwd": "${workspaceFolder}/leetcode/ts",
    "outputCapture": "std"
  }
  ]
}

tsconfig

{
  "compilerOptions": {
    "allowJs": true,
    "checkJs": true,
    "sourceMap": true,
    "noImplicitAny": true,
    "noUnusedLocals": true,
    "strictNullChecks": true,
    "preserveConstEnums": true,
    "noImplicitUseStrict": true,
    "experimentalDecorators": true,
    "allowSyntheticDefaultImports": true,
    "lib": ["es7", "dom"],
    "baseUrl": "./",
  }
}

The code I debug:

/*
 *
 *
 */

function foo() {
  console.info(1); // breakpoint 2
  console.info(2);
  console.info(3);
  console.info(4);
  console.info(5);
  console.info(6);
  console.info(7);
  console.info(8);
  console.info(9);
}

foo(); // breakpoint 1

Breakpoint 1 never paused.
What's more important is the line account of comment affects the position of wrong jumping.
For example, if comment is

/*
 *
 */

The cursor will jump to a file named 02_console.js after execute console.info(8)

if comment is

/*
 *
 *
 */

The cursor will jump to a file named 02_console.js after execute console.info(7)

if comment is

/*
 *
 *
 *
 */

The cursor will jump to a file named 02_console.js after execute console.info(6)

Does this issue occur when all extensions are disabled?: Yes

deno

@weinand weinand assigned connor4312 and unassigned weinand Aug 5, 2020
@weinand weinand added the debug Debug viewlet, configurations, breakpoints, adapter issues label Aug 5, 2020
@connor4312
Copy link
Member

connor4312 commented Aug 5, 2020

You appear to be using the old desbugger debug.javascript.usePreview: false, which does not handle in-place sourcemaps gracefully. Please use the new debugger which handles this better, instructions: denoland/vscode_deno#12 (comment)

@github-actions github-actions bot locked and limited conversation to collaborators Sep 19, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
debug Debug viewlet, configurations, breakpoints, adapter issues
Projects
None yet
Development

No branches or pull requests

3 participants