nodeguy/bd7838ba.3caa3abc.js

1 line
4.0 KiB
JavaScript

(window.webpackJsonp=window.webpackJsonp||[]).push([[163],{254:function(e,n,t){"use strict";t.r(n),t.d(n,"frontMatter",(function(){return o})),t.d(n,"rightToc",(function(){return c})),t.d(n,"metadata",(function(){return u})),t.d(n,"default",(function(){return s}));var a=t(1),r=t(6),i=(t(0),t(324)),o={sidebar_label:"Debugging in VSCode",title:"Debugging in VSCode"},c=[],u={id:"guides/debugging-in-vscode",title:"Debugging in VSCode",description:"- **Open a NodeGui project in VSCode.**",source:"@site/docs/guides/debugging-in-vscode.md",permalink:"/docs/guides/debugging-in-vscode",sidebar_label:"Debugging in VSCode",sidebar:"guides",previous:{title:"Debugging",permalink:"/docs/guides/debugging"},next:{title:"Using native Node Modules",permalink:"/docs/guides/using-native-node-modules"}},d={rightToc:c,metadata:u},p="wrapper";function s(e){var n=e.components,t=Object(r.a)(e,["components"]);return Object(i.b)(p,Object(a.a)({},d,t,{components:n,mdxType:"MDXLayout"}),Object(i.b)("ul",null,Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},Object(i.b)("strong",{parentName:"p"},"Open a NodeGui project in VSCode.")),Object(i.b)("pre",{parentName:"li"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-sh"}),"$ git clone git@github.com:nodegui/nodegui-starter.git\n$ code nodegui-starter\n"))),Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},Object(i.b)("strong",{parentName:"p"},"Add a file ",Object(i.b)("inlineCode",{parentName:"strong"},".vscode/launch.json")," with the following configuration:")),Object(i.b)("pre",{parentName:"li"},Object(i.b)("code",Object(a.a)({parentName:"pre"},{className:"language-json"}),'{\n "version": "0.2.0",\n "configurations": [\n {\n "name": "Debug Qode Process",\n "type": "node",\n "request": "launch",\n "cwd": "${workspaceRoot}",\n "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/qode",\n "windows": {\n "runtimeExecutable": "${workspaceRoot}/node_modules/.bin/qode.exe"\n },\n "args": ["./dist/index.js"],\n "outputCapture": "std"\n }\n ]\n}\n')),Object(i.b)("p",{parentName:"li"},Object(i.b)("strong",{parentName:"p"},"Tip"),": You could also configure a preLaunchTask for building typescript before launching the debugger everytime.")),Object(i.b)("li",{parentName:"ul"},Object(i.b)("p",{parentName:"li"},Object(i.b)("strong",{parentName:"p"},"Debugging")),Object(i.b)("p",{parentName:"li"},"Set some breakpoints in ",Object(i.b)("inlineCode",{parentName:"p"},"index.js"),", and start debugging in the ",Object(i.b)("a",Object(a.a)({parentName:"p"},{href:"https://code.visualstudio.com/docs/editor/debugging"}),"Debug View"),". You should be able to hit the breakpoints."))))}s.isMDXComponent=!0},324:function(e,n,t){"use strict";t.d(n,"a",(function(){return c})),t.d(n,"b",(function(){return s}));var a=t(0),r=t.n(a),i=r.a.createContext({}),o=function(e){var n=r.a.useContext(i),t=n;return e&&(t="function"==typeof e?e(n):Object.assign({},n,e)),t},c=function(e){var n=o(e.components);return r.a.createElement(i.Provider,{value:n},e.children)};var u="mdxType",d={inlineCode:"code",wrapper:function(e){var n=e.children;return r.a.createElement(r.a.Fragment,{},n)}},p=Object(a.forwardRef)((function(e,n){var t=e.components,a=e.mdxType,i=e.originalType,c=e.parentName,u=function(e,n){var t={};for(var a in e)Object.prototype.hasOwnProperty.call(e,a)&&-1===n.indexOf(a)&&(t[a]=e[a]);return t}(e,["components","mdxType","originalType","parentName"]),p=o(t),s=a,b=p[c+"."+s]||p[s]||d[s]||i;return t?r.a.createElement(b,Object.assign({},{ref:n},u,{components:t})):r.a.createElement(b,Object.assign({},{ref:n},u))}));function s(e,n){var t=arguments,a=n&&n.mdxType;if("string"==typeof e||a){var i=t.length,o=new Array(i);o[0]=p;var c={};for(var d in n)hasOwnProperty.call(n,d)&&(c[d]=n[d]);c.originalType=e,c[u]="string"==typeof e?e:a,o[1]=c;for(var s=2;s<i;s++)o[s]=t[s];return r.a.createElement.apply(null,o)}return r.a.createElement.apply(null,t)}p.displayName="MDXCreateElement"}}]);