PageSourceSearch

https://noir-lang.org/docs/assets/js/8ed19cd8.84d5c826.js

js noir-lang.org collected 2026-10-03 22:50:00 UTC 11,719 bytes, 1 lines download raw bytes

1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[339],{96837(e,n,i){i.d(n,{Ay:()=>s});var t=i(74848),r=i(28453);function o(e){const n={a:"a",admonition:"admonition",p:"p",strong:"strong",...(0,r.R)(),...e.components};return(0,t.jsxs)(n.admonition,{title:"Experimental Feature",type:"caution",children:[(0,t.jsx)(n.p,{children:"This feature is experimental. The documentation may be incomplete or out of date, which means it could change in future versions, potentially causing unexpected behavior or not working as expected."}),(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Contributions Welcome:"})," If you notice any inaccuracies or potential improvements, please consider contributing. Visit our GitHub repository to make your contributions: ",(0,t.jsx)(n.a,{href:"https://github.com/noir-lang/noir",children:"Contribute Here"}),"."]})]})}function s(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(o,{...e})}):o(e)}i.d(n,["RM",0,[]])},45635(e,n,i){i.r(n),i.d(n,{assets:()=>l,contentTitle:()=>c,default:()=>g,frontMatter:()=>d,metadata:()=>t,toc:()=>a});const t=JSON.parse('{"id":"tooling/debugger/debugger_vscode","title":"VS Code Debugger","description":"VS Code Debugger configuration and features.","source":"@site/versioned_docs/version-v1.0.0-rc.0/tooling/debugger/debugger_vscode.mdx","sourceDirName":"tooling/debugger","slug":"/tooling/debugger/debugger_vscode","permalink":"/docs/v1.0.0-rc.0/tooling/debugger/debugger_vscode","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/versioned_docs/version-v1.0.0-rc.0/tooling/debugger/debugger_vscode.mdx","tags":[],"version":"v1.0.0-rc.0","frontMatter":{"title":"VS Code Debugger","description":"VS Code Debugger configuration and features.","keywords":["Nargo","Noir CLI","Noir Debugger","VS Code","IDE"]},"sidebar":"sidebar","previous":{"title":"Debugger","permalink":"/docs/v1.0.0-rc.0/tooling/debugger/"},"next":{"title":"REPL Debugger","permalink":"/docs/v1.0.0-rc.0/tooling/debugger/debugger_repl"}}');var r=i(74848),o=i(28453),s=i(96837);const d={title:"VS Code Debugger",description:"VS Code Debugger configuration and features.",keywords:["Nargo","Noir CLI","Noir Debugger","VS Code","IDE"]},c=void 0,l={},a=[...s.RM,{value:"Creating and editing launch configuration files",id:"creating-and-editing-launch-configuration-files",level:2},{value:"Noir Debugger launch.json properties",id:"noir-debugger-launchjson-properties",level:3},{value:"projectFolder",id:"projectfolder",level:4},{value:"proverName",id:"provername",level:4},{value:"generateAcir",id:"generateacir",level:4},{value:"skipInstrumentation",id:"skipinstrumentation",level:4},{value:"testName",id:"testname",level:4},{value:"oracleResolver",id:"oracleresolver",level:4},{value:"<code>nargo dap [OPTIONS]</code>",id:"nargo-dap-options",level:2},{value:"Options",id:"options",level:3}];function h(e){const n={admonition:"admonition",code:"code",em:"em",h2:"h2",h3:"h3",h4:"h4",img:"img",p:"p",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",...(0,o.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(s.Ay,{}),"\n",(0,r.jsx)(n.p,{children:"The Noir debugger enabled by the vscode-noir extension ships with default settings such that the most common scenario should run without any additional configuration steps."}),"\n",(0,r.jsxs)(n.p,{children:["These defaults can nevertheless be overridden by defining a launch configuration file. This page provides a reference for the properties you can override via a launch configuration file, as well as documenting the Nargo ",(0,r.jsx)(n.code,{children:"dap"})," command, which is a dependency of the VS Code Noir debugger."]}),"\n",(0,r.jsx)(n.h2,{id:"creating-and-editing-launch-configuration-files",children:"Creating and editing launch configuration files"}),"\n",(0,r.jsxs)(n.p,{children:["To create a launch configuration file from VS Code, open the ",(0,r.jsx)(n.em,{children:"debug pane"}),", and click on ",(0,r.jsx)(n.em,{children:"create a launch.json file"}),"."]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Creating a launch configuration file",src:i(95718).A+"",width:"1032",height:"708"})}),"\n",(0,r.jsxs)(n.p,{children:["A ",(0,r.jsx)(n.code,{children:"launch.json"})," file will be created, populated with basic defaults."]}),"\n",(0,r.jsx)(n.h3,{id:"noir-debugger-launchjson-properties",children:"Noir Debugger launch.json properties"}),"\n",(0,r.jsx)(n.h4,{id:"projectfolder",children:"projectFolder"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"String, optional."})}),"\n",(0,r.jsxs)(n.p,{children:["Absolute path to the Nargo project to debug. By default, it is dynamically determined by looking for the nearest ",(0,r.jsx)(n.code,{children:"Nargo.toml"})," file to the active file at the moment of launching the debugger."]}),"\n",(0,r.jsx)(n.h4,{id:"provername",children:"proverName"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"String, optional."})}),"\n",(0,r.jsxs)(n.p,{children:["Name of the prover input to use. Defaults to ",(0,r.jsx)(n.code,{children:"Prover"}),", which looks for a file named ",(0,r.jsx)(n.code,{children:"Prover.toml"})," at the ",(0,r.jsx)(n.code,{children:"projectFolder"}),"."]}),"\n",(0,r.jsx)(n.h4,{id:"generateacir",children:"generateAcir"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"Boolean, optional."})}),"\n",(0,r.jsxs)(n.p,{children:["If true, generate ACIR opcodes instead of unconstrained opcodes which will be closer to release binaries but less convenient for debugging. Defaults to ",(0,r.jsx)(n.code,{children:"false"}),"."]}),"\n",(0,r.jsx)(n.h4,{id:"skipinstrumentation",children:"skipInstrumentation"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"Boolean, optional."})}),"\n",(0,r.jsxs)(n.p,{children:["Skips variables debugging instrumentation of code, making debugging less convenient but the resulting binary smaller and closer to production. Defaults to ",(0,r.jsx)(n.code,{children:"false"}),"."]}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsx)(n.p,{children:"Skipping instrumentation causes the debugger to be unable to inspect local variables."})}),"\n",(0,r.jsx)(n.h4,{id:"testname",children:"testName"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"String, optional."})}),"\n",(0,r.jsx)(n.p,{children:"Test name (or substring) of the test function to debug. The name is not required to match exactly, as long as it's non-ambiguou
1s.\nFor the debugger to run, only one test function should match the name lookup."}),"\n",(0,r.jsxs)(n.p,{children:["ie: if there are two test functions ",(0,r.jsx)(n.code,{children:"test_simple_assert"})," and ",(0,r.jsx)(n.code,{children:"test_increment"}),", setting ",(0,r.jsx)(n.code,{children:"--test-name test_"})," will fail with ",(0,r.jsx)(n.code,{children:"'test_' matches with more than one test function"}),". Instead, setting ",(0,r.jsx)(n.code,{children:"--test_name test_simple"})," is not ambiguous, so the debugger will start debugging the ",(0,r.jsx)(n.code,{children:"test_simple_assert"})," test function."]}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["When provided, the debugger will debug the matching function instead of the package ",(0,r.jsx)(n.code,{children:"main"})," function."]})}),"\n",(0,r.jsx)(n.h4,{id:"oracleresolver",children:"oracleResolver"}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.em,{children:"String, optional."})}),"\n",(0,r.jsx)(n.p,{children:"JSON RPC URL to solve oracle calls."}),"\n",(0,r.jsx)(n.admonition,{type:"note",children:(0,r.jsxs)(n.p,{children:["When the debugger is run using the ",(0,r.jsx)(n.code,{children:"Debug test"})," codelens, this option is set from the ",(0,r.jsx)(n.code,{children:"TXE_TARGET"})," environment variable value."]})}),"\n",(0,r.jsx)(n.h2,{id:"nargo-dap-options",children:(0,r.jsx)(n.code,{children:"nargo dap [OPTIONS]"})}),"\n",(0,r.jsx)(n.p,{children:"When run without any option flags, it starts the Nargo Debug Adapter Protocol server, which acts as the debugging backend for the VS Code Noir Debugger."}),"\n",(0,r.jsx)(n.p,{children:"All option flags are related to preflight checks. The Debug Adapter Protocol specifies how errors are to be informed from a running DAP server, but it doesn't specify mechanisms to communicate server initialization errors between the DAP server and its client IDE."}),"\n",(0,r.jsxs)(n.p,{children:["Thus ",(0,r.jsx)(n.code,{children:"nargo dap"})," ships with a ",(0,r.jsx)(n.em,{children:"preflight check"})," mode. If flag ",(0,r.jsx)(n.code,{children:"--preflight-check"})," and the rest of the ",(0,r.jsx)(n.code,{children:"--preflight-*"})," flags are provided, Nargo will run the same initialization routine except it will not start the DAP server."]}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"vscode-noir"})," will then run ",(0,r.jsx)(n.code,{children:"nargo dap"})," in preflight check mode first before a debugging session starts. If the preflight check ends in error, vscode-noir will present stderr and stdout output from this process through its own Output pane in VS Code. This makes it possible for users to diagnose what pieces of configuration might be wrong or missing in case of initialization errors."]}),"\n",(0,r.jsxs)(n.p,{children:["If the preflight check succeeds, ",(0,r.jsx)(n.code,{children:"vscode-noir"})," proceeds to start the DAP server normally but running ",(0,r.jsx)(n.code,{children:"nargo dap"})," without any additional flags."]}),"\n",(0,r.jsx)(n.h3,{id:"options",children:"Options"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Option"}),(0,r.jsx)(n.th,{children:"Description"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"--preflight-check"})}),(0,r.jsx)(n.td,{children:"If present, dap runs in preflight check mode."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"--preflight-project-folder <PREFLIGHT_PROJECT_FOLDER>"})}),(0,r.jsx)(n.td,{children:"Absolute path to the project to debug for preflight check."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"--preflight-prover-name <PREFLIGHT_PROVER_NAME>"})}),(0,r.jsx)(n.td,{children:"Name of prover file to use for preflight check"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"--preflight-generate-acir"})}),(0,r.jsx)(n.td,{children:"Optional. If present, compile in ACIR mode while running preflight check."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"--preflight-skip-instrumentation"})}),(0,r.jsx)(n.td,{children:"Optional. If present, compile without introducing debug instrumentation while running preflight check."})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"-h, --help"})}),(0,r.jsx)(n.td,{children:"Print help."})]})]})]})]})}function g(e={}){const{wrapper:n}={...(0,o.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(h,{...e})}):h(e)}},95718(e,n,i){const t=i.p+"assets/images/ref1-create-launch-c0d86e35c4eaaa744bdbf385aeddcecf.png";i.d(n,["A",0,t])},28453(e,n,i){i.d(n,{R:()=>s,x:()=>d});var t=i(96540);const r={},o=t.createContext(r);function s(e){const n=t.useContext(o);return t.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),t.createElement(o.Provider,{value:n},e.children)}}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.