how to debug and step through vscode itself? - debugging

I am interested in stepping through the markdown preview code in vscode and seeing how it works. As far as I can tell, this is not an extension, it's a core part of vscode. I found some documentation on how to debug an extension, but cannot find how to debug code that is just part of vscode. Presumably it's all javascript or typescript.
Taking for example editing markdown, how can I intercept and see what happens in markdown mode, and how can I set a breakpoint, and step through refresh preview in the preview?

Related

Bring VS Code to the foreground when breaking in the debugger

Regular Visual studio has this nice feature. I don't think it is available in VS Code.
When a breakpoint hits you can jump right to bebugging (pressing f5,f10 etc) without having to click on the IDE first. I love this feature. Does anyone know if VS Code supports this as well?
I think it is supposed to focus the vscode window. There is this setting:
Debug : Focus Window on Break
which is enabled by default. But see https://github.com/microsoft/vscode/issues/80441 and https://github.com/microsoft/vscode/pull/77213 it looks there are issues.
It doesn't work for me either on Win10. I added my example to https://github.com/microsoft/vscode/issues/105913. You may want to do the same.

webstorm 10 chrome extension debugging

I installed the extension in chrome and the run and debug icons show up in the Webstorm IDE. I start a debugging session and it opens the page in chrome and live updates occur when I change the HTML. The debug window also opens in the IDE in webstorm and I can see all of the usual elements of a debug session, except: I can only view the HTML page - I can't view other assets like js files that are loaded via script tags - and I can't set breakpoints in the script in the HTML file, let alone in the other assets and I can't set breakpoints in the editor in the IDE.
Is this working or not?
One of the best things about debugging with WebStorm is that you put breakpoints in your original files in the editor. Here's an example: https://youtu.be/JnMvok0Yks8?t=10m22s

Setting breakpoints in a JavaScript file (run in IE) in Visual Studio

I'm working on a web page as part of an ASP .Net application. When I include my JavaScript within a script node in the page I can set breakpoints in the JavaScript in Visual Studio and when I debug the project (which launches the page locally in IE) the breakpoint is successfully caught in Visual Studio and I can use it to inspect variables, step through, and do all the usual Visual Studio debugging stuff. However, when I move my JavaScript to a separate script file breakpoints stop working, and I see the message 'The breakpoint will not currently be hit. No symbols have been loaded for this document.'
I know I could take advantage of the browser's debugging tools but how do I get Visual Studio to hit breakpoints in a JavaScript file in an ASP .Net application?
It would also be good to understand why the breakpoint works when the JavaScript is included in a script node within the HTML page, and fails when it is moved to a separate JavaScript file?
Here are the steps:
1) First open Visual studio -> select your project in solution explorer.-> Right click and choose option "browse with" then set IE as default browser.
2) Now open IE. Go to,
Tools -> Internet option -> Advance -> uncheck the checkbox having "Disable Script Debugging (Internet Explorer) and then click Apply and OK and you are done.
3) Now you can set breakpoints in your JS file and then hit the debug button in VS.
I think the point I made in the question about having the JavaScript in the HTML file versus in a separate script file may have been misleading. It tried copying it back and it still did not work!
I have made two changes and now it is fixed (though I am not sure which one fixed it).
Firstly I checked the closing curly brackets on each function in my JavaScript (after reading robert4's answer to What can be the reasons for JavaScript breakpoint is not hit) and added a missing semi-colon after the function I'd recently added.
Secondly I held down the Ctrl key and clicked refresh in the IE launched by Visual Studio which should force a page reload (instead of loading from IE's cache).
I'm assuming that the second of these changes fixed things but I've included the first to just-in-case it proves useful.

How to debug Mono itself?

I want to fix a bug in Mono's XML deserializer.
The code is quite complex.
How can I run Mono itself in debug mode? (breakpoints, step-by-step, variables inspection).
Preferably in a graphical way.
If Monodevelop can be used to debug Mono itself, that would be great.
I am on Linux Ubuntu 2012.04 and have enabled debugging information.
In MonoDevelop, after loading the solution, go to the Edit menu -> Preferences. Select Debugger and uncheck "Debug project code only...".

Webstorm debugging with Chrome?

I am unable to debug at al in Chrome. I set it as my default broswer but when I try to debug, I see Connecting to 127.0.0.1:7930 in the Debugger window, but nothing happens (Chrome doesn't popup or anything). I have no idea how to trouble shoot this....any ideas?
If you are not familiar with, and believe me its worth checking out...another alternative is to use the Chrome developer Tools Built into the browser
You can debug javascript (add breakpoints and step into over, view variables), edit css and see your modifications in real time and save changes back to your file system. It also has a revision history for changes you make and you can revert back to any version! You can use use these Chrome developer tools in conjunction with the free Netbeans IDE where you can create your HTML, CSS & Javascript which has excellent code hinting / completion with Jquery support. You also add plugins to add more functionality.
Well I could not figure out how the heck to get Webstorm to debug with Chrome and their support is extremely limited. So as a workaround and what may be better because its free , is use Eclipse with Chrome Developer tools.
You are able to debug all the JavaScript files on your server and set breakpoints. I haven't stepped through while debugging, but this seems very promising. You could use Eclipse as well for the development of your corresponding HTML and css files or use in conjunction with Netbeans which is also free. Very straightforward if you are familiar with Eclipse already:
Eclipse with Chrome Developer Tools

Resources