Giter Club home page Giter Club logo

vscode-chrome-debug-core's Introduction

This project is deprecated. See https://github.com/microsoft/vscode-js-debug

vscode-chrome-debug-core

Join the chat at https://gitter.im/Microsoft/vscode-chrome-debug Build Status

A library for building VS Code debug adapters for targets that support the Chrome Debugging Protocol.

Debuggers using this library


This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

vscode-chrome-debug-core's People

Contributors

altitudeapps avatar andysterland avatar auchenberg avatar basteln3rk avatar changsi-an avatar connor4312 avatar danyeh avatar digeff avatar empoman avatar ericcornelson avatar isidorn avatar jalissia avatar kant avatar kieferrm avatar llgcode avatar martinma avatar mlewand avatar mrcrane avatar msftgits avatar mslaguana avatar obastemur avatar patobeltran avatar rdegelo avatar redmickey avatar roblourens avatar sbatten avatar shenniey avatar sound120 avatar stristr avatar torn4dom4n avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

vscode-chrome-debug-core's Issues

Add support for nwjs debug targets

We should add support for NWJS debug targets.

NW.js targets exposes debug targets with the type of app instead of page, which means they get rejected by our filtering logic.

{
   "description": "",
   "devtoolsFrontendUrl": "/devtools/inspector.html?ws=localhost:9222/devtools/page/FFE11F8E-2423-44FC-9A06-D3002DCC85BA",
   "faviconUrl": "chrome://extension-icon/nochadnphaoigfjnaclpecjelllocobm/24/1",
   "id": "FFE11F8E-2423-44FC-9A06-D3002DCC85BA",
   "title": "angular2-quickstart",
   "type": "app",
   "url": "chrome-extension://nochadnphaoigfjnaclpecjelllocobm/dashboard",
   "webSocketDebuggerUrl": "ws://localhost:9222/devtools/page/FFE11F8E-2423-44FC-9A06-D3002DCC85BA"
}

More details: https://github.com/Microsoft/vscode-chrome-debug/issues/153#issuecomment-222588098

webRoot could be optional

From @roblourens on November 26, 2015 6:2

If Code is open at project/ and files are served from project/wwwroot, and it needs to resolve localhost/app.js, the extension could glob for project/*/app.js instead of requiring webRoot to fill the gap.

Copied from original issue: Microsoft/vscode-chrome-debug#52

Resolve sourcemaps before scripts are loaded, like the Node adapter

From @roblourens on November 5, 2015 5:44

Example:
Debugger is attached to Chrome. b.js has code like this:

var x = 1;
function f() {
    console.log('test');
}

User sets a breakpoint on the first line, and another inside function f. When b.js is loaded on the page, the first line bp will not be hit. When f() executes, that breakpoint will be hit. The adapter currently waits for b.js to be loaded before setting its breakpoints, so it knows its full path.

The problem is that before b.js is loaded, the adapter doesn't know what its exact url will be. Maybe Chrome is on www.mysite.com and the local file is C:/folderA/folderB/folderC/b.js. We can fix it by introducing another launch config field, like webRoot which the user sets to C:/folderA so the adapter will know that b.js is on www.mysite.com/folderB/folderC/b.js.

Workaround - attach to Chrome, set the breakpoint in b.js, cause b.js to be loaded (but BP is not hit), refresh the page, now when b.js is loaded, the breakpoint should be hit.

Copied from original issue: Microsoft/vscode-chrome-debug#20

webkitUrlToClientPath in utilities.ts strips out too many slashes

From @MSLaguana on January 14, 2016 23:17

In webkitUrlToClientPath, when converting file:/// paths, you remove three slashes rather than two, which converts an absolute path into a relative one. This means that the behaviour can differ based on where you run vs code from.

Copied from original issue: Microsoft/vscode-chrome-debug#80

Clean up diagnostic logs

From @roblourens on November 26, 2015 6:0

The logs from the diagnosticLogging option are very verbose and not terribly readable.

Copied from original issue: Microsoft/vscode-chrome-debug#51

Reconsider the unit testing situation

From @roblourens on April 4, 2016 3:38

I've figured out a workflow with sinon + mockery, and they are fine on their own, but they avoid some of the benefits of TS while adding extra complications. Investigate typemoq, jest, and any other promising test mock libraries.

Copied from original issue: Microsoft/vscode-chrome-debug#144

Smart code stepping

P2, 5 days
New node adapter feature - auto steps through code without a source mapping. I think F12 does this? And I think Braude implemented this in CDT or something. Sounds familiar.

Breakpoint set a wrong line number when resolving source map

From @auchenberg on May 24, 2016 9:47

Actual:

  1. Set breakpoint at line number 200 in app/controllers/app.js
  1. Breakpoint set at line number 234 within app/controllers/app.js open in VS Code.

Expected:

  1. Set breakpoint at line number 200 in app/controllers/app.js
  1. Breakpoint set at line number 200 within app/controllers/app.js open in VS Code.

Cause:
Mapped line number from sourcemapped file app_bundled.js is used.

Log:

›From client: setBreakpoints({"source":{"path":"/Users/auchenberg/Development/timey.in/app/controllers/app.js"},"lines":[200],"breakpoints":[{"line":200}]})
›SourceMaps.setBP: Mapped /Users/auchenberg/Development/timey.in/app/controllers/app.js to http://localhost:8080/app_bundled.js
›SourceMaps.setBP: Mapped /Users/auchenberg/Development/timey.in/app/controllers/app.js:199:0 to http://localhost:8080/app_bundled.js:233:0
›Paths.setBP: http://localhost:8080/app_bundled.js is already a URL
›To target: {"id":26,"method":"Debugger.setBreakpointByUrl","params":{"url":"http://localhost:8080/app_bundled.js","lineNumber":233,"columnNumber":0}}
›From target: {"id":26,"result":{"breakpointId":"http://localhost:8080/app_bundled.js:233:0","locations":[{"scriptId":"38","lineNumber":233,"columnNumber":4}]}}
›SourceMaps.setBP: Can't map http://localhost:8080/app_bundled.js:233:4, keeping the line number as-is.
›To client: {"seq":0,"type":"response","request_seq":22,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"verified":true,"line":234}]}}

Copied from original issue: Microsoft/vscode-chrome-debug#162

Resolving url <=> path should be case-insensitive

From @ElfenLiedGH on December 24, 2015 8:20

debug console

›OS: win32 ia32
  ›Node version: v4.1.1
  ›Adapter version: 0.2.1
  ›initialize({"adapterID":"chrome","linesStartAt1":true,"pathFormat":"path"})
  ›attach({"name":"Attach","type":"chrome","request":"attach","port":9222,"diagnosticLogging":true,"outDir":null,"address":"localhost","program":null,"stopOnEntry":false,"args":null,"cwd":"c:\\DTEST\\STACK.SRV\\JS","runtimeExecutable":null,"runtimeArgs":null})
  ›Attempting to attach on port 9222
  ›To target: {"id":1,"method":"Debugger.enable"}
  ›From target: {"method":"Debugger.scriptParsed","params":{"endColumn":0,"endLine":443,"scriptId":"39","startColumn":0,"startLine":0,"url":"file:///C:/DTEST/STACK.SRV/JS/CLASSES/BASE/BASECLASSES.JS"}}
  ›Paths.scriptParsed: resolved file:///C:/DTEST/STACK.SRV/JS/CLASSES/BASE/BASECLASSES.JS to c:\DTEST\STACK.SRV\JS\CLASSES\BASE\BASECLASSES.JS. webRoot: c:\DTEST\STACK.SRV\JS
  ›From target: {"method":"Debugger.scriptParsed","params":{"endColumn":1,"endLine":189,"scriptId":"40","startColumn":0,"startLine":0,"url":"file:///C:/DTEST/STACK.SRV/JS/CLASSES/BASE/BRIDGE.JS"}}
  ›Paths.scriptParsed: resolved file:///C:/DTEST/STACK.SRV/JS/CLASSES/BASE/BRIDGE.JS to c:\DTEST\STACK.SRV\JS\CLASSES\BASE\BRIDGE.JS. webRoot: c:\DTEST\STACK.SRV\JS
  ...
  ›From target: {"id":1,"result":{}}
  ›To target: {"id":2,"method":"Console.enable"}
  ›From target: {"error":{"code":-32601,"message":"'Console.enable' wasn't found"},"id":2}
  ›To client: {"seq":0,"type":"event","event":"initialized"}
  ›To client: {"seq":0,"type":"response","request_seq":2,"command":"attach","success":true}
  ›From client: setExceptionBreakpoints({"filters":["uncaught"]})
  ›To target: {"id":3,"method":"Debugger.setPauseOnExceptions","params":{"state":"uncaught"}}
  ›From target: {"id":3,"result":{}}
  ›To client: {"seq":0,"type":"response","request_seq":3,"command":"setExceptionBreakpoints","success":true}
  ›From client: setBreakpoints({"source":{"path":"c:\\DTEST\\STACK.SRV\\JS\\SELECTS\\BASE\\BASESELECTS.js"},"lines":[19]})
  ›Paths.setBP: No target url cached for client path: c:\DTEST\STACK.SRV\JS\SELECTS\BASE\BASESELECTS.js, waiting for target script to be loaded.

but if change to upper case BASESELECTS.JS, it work

›To target: {"id":4,"method":"Debugger.setBreakpointByUrl","params":{"url":"file:///C:/DTEST/STACK.SRV/JS/SELECTS/BASE/BASESELECTS.JS","lineNumber":18,"columnNumber":0}}
  ›From target: {"id":4,"result":{"breakpointId":"file:///C:/DTEST/STACK.SRV/JS/SELECTS/BASE/BASESELECTS.JS:18:0","locations":[{"columnNumber":8,"lineNumber":18,"scriptId":"51"}]}}
  ›To client: {"seq":0,"type":"response","request_seq":4,"command":"setBreakpoints","success":true,"body":{"breakpoints":[{"verified":true,"line":19}]}} 

server load script with upper case

Copied from original issue: Microsoft/vscode-chrome-debug#73

Target URL search should be case-insensitive

From @vsccarl on April 22, 2016 17:54

Code Version: 1.0.1-alpha
OS: Windows 10

I'm getting an error when launching an html file but it runs and opens in chrome correctly.

chromedebugwarning

My launch.json looks like this:

{
            "name": "Launch index.html with sourcemaps",
            "type": "chrome",
            "request": "launch",
            "file": "${workspaceRoot}/index.html",
            "sourceMaps": true,
            "webRoot": "${workspaceRoot}"
        }

Copied from original issue: Microsoft/vscode-chrome-debug#156

Support debugging "Just my code"

From @maxhor on March 30, 2016 14:48

When setting a breakpoint in typescript and then stepping through code, (either step over, step into, step out): I will end up in the javascript code that was generated from the typescript or in the code from libraries under node_modules (like Angularjs).

How can I change the settings so that when debugging my code, everything besides the typescript that I wrote myself is stepped over?

Copied from original issue: Microsoft/vscode-chrome-debug#137

Support manual override of sourceRoot

There's a bug in gulp-sourcemaps < 2.0.0-alpha where it uses sourceRoot: /source/ by default. This impacts ionic, the ionic2 beta so far, and anyone else using gulp-sourcemaps directly or indirectly. The result is that the file path data in the sourcemap is simply wrong, but the source content is inlined, so it doesn't matter for browser devtools.

In the Ionic case, I honestly can't figure out how to set the sourceRoot from the gulpfile. But it would be really easy to have an option in the launch config to override the sourceRoot globally or for app.bundle.js.

Ignore this, I ended up doing it differently

"sourceRoot": "${workspaceRoot}"
...
"sourceRoot": "/.." // Looks like nonsense but the proper sourceRoot for the default Ionic2 config is the directory above the webRoot
...
"sourceRoot": {
    "bundle.js.map": "${workspaceRoot}",
    "bundle*": "${workspaceRoot}",
    "somethingElse.js.map": "c:\\project\\src"
}

Obviously it's better to fix your build config but this might be nice to get us through this gulp-sourcemaps bug, maybe combined with better logging and optional webRoot.

Breakpoints in eval scripts aren't rebound after refreshing the page

Microsoft/vscode-chrome-debug#158 brought in sourcemap support for eval scripts. However, rebinding breakpoints on refresh depends on the Chrome API Debugger.setBreakpointByURL, and eval scripts don't use that since they don't have URLs. I need to keep a mapping of sourcemap URL to breakpoints in eval scripts, and restore these manually after the page refresh. I think this is what Chrome devtools are doing. That doesn't work naturally with the general design so I need to think about how to do that.

There is a hash parameter with the scriptParsed event, but it works in CDT even when the script changes, so I don't think they're using it for this.

Also this won't work for breakpoints in global code, but that's impossible for eval scripts, and CDT doesn't do that either.

Error when trying to install typings

➜  vscode-chrome-debug-core git:(master) ✗ typings install --ambient --save es6-collections es6-promise node
typings ERR! message Unable to find "node" ("npm") in the registry. Did you want to try searching another source? Also, if you want contribute these typings, please help us: https://github.com/typings/registry
typings ERR! caused by https://api.typings.org/entries/npm/node/versions/latest responded with 404, expected it to equal 200

typings ERR! cwd /Users/auchenberg/Development/vscode-ios-web-debug/node_modules/vscode-chrome-debug-core
typings ERR! system Darwin 15.0.0
typings ERR! command "/Users/auchenberg/.nvm/versions/node/v5.1.0/bin/node" "/Users/auchenberg/.nvm/versions/node/v5.1.0/bin/typings" "install" "--ambient" "--save" "es6-collections" "es6-promise" "node"
typings ERR! node -v v5.1.0
typings ERR! typings -v 1.0.4

typings ERR! If you need help, you may report this error at:
typings ERR!   <https://github.com/typings/typings/issues>

The debugger can't connect to a server with windows authentication to download the map files

From @jtarquino on February 16, 2016 17:7

When it launch chrome connecting to a server that uses windows authentication, the extension fails to download the map files with a 401 unauthorized request
The problem seems to be located in the sourceMapTransformer.ts method public scriptParsed(event: DebugProtocol.Event).

also the utilities.ts doesn't log the http error in the logger so its hard to figure out why the extension wasn't able to load the map files

Copied from original issue: Microsoft/vscode-chrome-debug#103

Enable break on exception buttons

From @isRyven on June 1, 2016 16:47

How to make VS Code to pause execution once it encounters exceptions and show the problematic line?
Seems i can't make the Code to break on error anyhow: i don't see options like: "All exceptions" and "Uncaught exceptions" in the Breakpoints section, and didn't find anything useful in the debugger docs. This seems pretty weird.

Copied from original issue: Microsoft/vscode-chrome-debug#165

Work on path/url handling

P1, 2 days
I would really like to implement something like this, since confusing types of paths/urls are probably the most common thing that I mess up.

Localization

P2, 4 days
The Node adapter is localized and we should be too, especially for our Node adapter.

Support source mapping of stack traces in the Debug Console

From @auchenberg on March 22, 2016 22:11

When an error is thrown with a stack trace, we should support source mapping of the source:

Actual:
app js - timey in 2016-03-22 15-09-38

Click on Scope.$scope.onAddNewClick (http://localhost:8080/app_bundled.js:234:5) triggers:
app js - timey in 2016-03-22 15-10-13

Expected:
Path to files within stack traces are source mapped to the original source.

Copied from original issue: Microsoft/vscode-chrome-debug#132

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.