-
Notifications
You must be signed in to change notification settings - Fork 35.2k
Description
In the Julia extension we have crash reporting setup, so that we send a crash report whenever an exception occurs in our extension. We also bundle our extension with webpack. One problem is that the stack traces in the exceptions (if something goes wrong) are essentially useless, as they refer to locations in the bundled version of the extension, i.e. everything on line 1 :) We do actually ship a source map file in the extension, but the information in there doesn't show up in the exception objects.
I think there are broadly speaking two ways to improve the situation: 1) run the extension host with the --enable-source-maps
flag (but note that any custom Error.prepareStackTrace
handler is then disabled, or 2) modify the already existing Error.prepareStackTrace
handler in the extension host
(<any>Error).prepareStackTrace = (error: Error, stackTrace: errors.V8CallSite[]) => { |
I am experimenting with that at the moment by using the https://www.npmjs.com/package/source-map-support package in our extension. That actually does lead to error objects that have stack traces that use the source map information, so that is great. The drawback, though, is that by using this package I think we are overriding the default VS Code Error.prepareStackTrace
handler that gets set here, and potentially even for not just our extension? That seems really bad, but at the moment I don't really have a better idea on how to handle that...
I think the ideal situation is that the default Error.prepareStackTrace
that the VS Code extension hosts installs essentially provides the same functionality that the source-map-support
package provides.