1"use strict";(globalThis.webpackChunkdocs=globalThis.webpackChunkdocs||[]).push([[1597],{70831(e,n,t){t.r(n),t.d(n,{assets:()=>l,contentTitle:()=>a,default:()=>g,frontMatter:()=>s,metadata:()=>o,toc:()=>d});const o=JSON.parse('{"id":"tooling/language_server","title":"Language Server","description":"Learn about the Noir Language Server, how to install the components, and configuration that may be required.","source":"@site/versioned_docs/version-v1.0.0-rc.2/tooling/language_server.md","sourceDirName":"tooling","slug":"/tooling/language_server","permalink":"/docs/tooling/language_server","draft":false,"unlisted":false,"editUrl":"https://github.com/noir-lang/noir/edit/master/docs/versioned_docs/version-v1.0.0-rc.2/tooling/language_server.md","tags":[],"version":"v1.0.0-rc.2","frontMatter":{"title":"Language Server","description":"Learn about the Noir Language Server, how to install the components, and configuration that may be required.","keywords":["Nargo","Language Server","LSP","VSCode","Visual Studio Code"]},"sidebar":"sidebar","previous":{"title":"Traits","permalink":"/docs/libraries/standard_library/traits"},"next":{"title":"Tests","permalink":"/docs/tooling/tests"}}');var r=t(74848),i=t(28453);const s={title:"Language Server",description:"Learn about the Noir Language Server, how to install the components, and configuration that may be required.",keywords:["Nargo","Language Server","LSP","VSCode","Visual Studio Code"]},a=void 0,l={},d=[{value:"Language Server",id:"language-server",level:2},{value:"Language Client",id:"language-client",level:2},{value:"Configuration",id:"configuration",level:3}];function c(e){const n={a:"a",blockquote:"blockquote",code:"code",h2:"h2",h3:"h3",img:"img",li:"li",p:"p",strong:"strong",ul:"ul",...(0,i.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"This section helps you install and configure the Noir Language Server."}),"\n",(0,r.jsxs)(n.p,{children:["The Language Server Protocol (LSP) has two components, the ",(0,r.jsx)(n.a,{href:"#language-server",children:"Server"})," and the ",(0,r.jsx)(n.a,{href:"#language-client",children:"Client"}),". Below we describe each in the context of Noir."]}),"\n",(0,r.jsx)(n.h2,{id:"language-server",children:"Language Server"}),"\n",(0,r.jsx)(n.p,{children:"The Server component is provided by the Nargo command line tool that you installed at the beginning of this guide.\nAs long as Nargo is installed and you've used it to run other commands in this guide, it should be good to go!"}),"\n",(0,r.jsxs)(n.p,{children:["If you'd like to verify that the ",(0,r.jsx)(n.code,{children:"nargo lsp"})," command is available, you can run ",(0,r.jsx)(n.code,{children:"nargo --help"})," and look for ",(0,r.jsx)(n.code,{children:"lsp"})," in the list of commands. If you see it, you're using a version of Noir with LSP support."]}),"\n",(0,r.jsx)(n.h2,{id:"language-client",children:"Language Client"}),"\n",(0,r.jsx)(n.p,{children:"The Client component is usually an editor plugin that launches the Server. It communicates LSP messages between the editor and the Server. For example, when you save a file, the Client will alert the Server, so it can try to compile the project and report any errors."}),"\n",(0,r.jsxs)(n.p,{children:["Currently, Noir provides a Language Client for Visual Studio Code via the ",(0,r.jsx)(n.a,{href:"https://github.com/noir-lang/vscode-noir",children:"vscode-noir"})," extension. You can install it via the ",(0,r.jsx)(n.a,{href:"https://marketplace.visualstudio.com/items?itemName=noir-lang.vscode-noir",children:"Visual Studio Marketplace"}),"."]}),"\n",(0,r.jsxs)(n.blockquote,{children:["\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.strong,{children:"Note:"})," Noir's Language Server Protocol support currently assumes users' VSCode workspace root to be the same as users' Noir project root (i.e. where Nargo.toml lies)."]}),"\n",(0,r.jsx)(n.p,{children:"If LSP features seem to be missing / malfunctioning, make sure you are opening your Noir project directly (instead of as a sub-folder) in your VSCode instance."}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"When your language server is running correctly and the VSCode plugin is installed, you should see handy codelens buttons for c
1ompilation, measuring circuit size, execution, and tests:"}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.img,{alt:"Compile and Execute",src:t(59932).A+"",width:"164",height:"22"}),"\n",(0,r.jsx)(n.img,{alt:"Run test",src:t(37145).A+"",width:"65",height:"15"})]}),"\n",(0,r.jsxs)(n.p,{children:["You should also see your tests in the ",(0,r.jsx)(n.code,{children:"testing"})," panel:"]}),"\n",(0,r.jsx)(n.p,{children:(0,r.jsx)(n.img,{alt:"Testing panel",src:t(66824).A+"",width:"407",height:"199"})}),"\n",(0,r.jsx)(n.h3,{id:"configuration",children:"Configuration"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Noir: Enable LSP"})," - If checked, the extension will launch the Language Server via ",(0,r.jsx)(n.code,{children:"nargo lsp"})," and communicate with it."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Noir: Nargo Flags"})," - Additional flags may be specified if you require them to be added when the extension calls ",(0,r.jsx)(n.code,{children:"nargo lsp"}),"."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Noir: Nargo Path"})," - An absolute path to a Nargo binary with the ",(0,r.jsx)(n.code,{children:"lsp"})," command. This may be useful if Nargo is not within the ",(0,r.jsx)(n.code,{children:"PATH"})," of your editor."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Noir > Trace: Server"})," - Setting this to ",(0,r.jsx)(n.code,{children:'"messages"'})," or ",(0,r.jsx)(n.code,{children:'"verbose"'})," will log LSP messages between the Client and Server. Useful for debugging."]}),"\n"]})]})}function g(e={}){const{wrapper:n}={...(0,i.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(c,{...e})}):c(e)}},59932(e,n,t){t.d(n,["A",0,"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAKQAAAAWCAIAAADB1aBoAAAAA3NCSVQICAjb4U/gAAAIC0lEQVRoge2Z/VNT6RXHT+CSXHKDcUkIJRqBNGZZwEUNJhgXLOHFl904G5SOWds61K52HLvO2h/27+hMu0ud2bG+raxSWaWCAqsFTFA0vJlEiNnwHkwIMcHc3Bt5DP2BLEWIGoTabcnnp3tzz3Oe85xvnvOcO5fxboYYoqwMYv7bAUR5e0TFXkFExV5BRMVeQUTFXkH85MUWFR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33dLKRDVa6/SBT6xqtOgPPudh0SvJUdec/rwMoEpvqvTbgJ9l2FYl4x4JJAAnOHzbrlDTmM/ud0R4uiU7eCCYBPPBwybayEoSiwmrN4cqykNsvxKIAQG2nZc4u0zxS4nPdZsf8wuZkr8bGO7vYeJHx3HsMEXO5ThSXN0ZrAJX9CGEYhi42tl9sAgDsoxGQ0SvTfd12Q6Pxowut4bsD/U6/sIOWPSiR+Nn52bCQxi1kYXw4/HGz4eA0GwZZ2/IlTybPx85Mu4AoJlOBka977j+5VAn/qM3vOlDe8r7FFP/mug/bWkKm/kCkkLv/p46ObvvEnJj+F8nLelB1/FgBgMWEqCgp2g8AiiNVL+XvRQEgztwPFxuatYU0ALpQoykEnlNrVHIAZJGPi6uggXVxefl5lVr+mLZzHYg05x0ZHpwIZSh9C3j30Own5uPaO30z7kFfm+lMe60kiXwgENXtTYQwedMmN7eevmzJB1mam3R087EXqt86pVfmEZJ6GHD23UsBKY/Lb2lpv9gS7P/uui8J6vFd491LXxTz3pHhQU9IzN1mniZsatCUMPG5Z6z6R9j0Ep/J9089/g93vr8AzRSBA8PSv2UAAAAASUVORK5CYII="])},66824(e,n,t){const o=t.p+"assets/images/codelens_testing_panel-67748b8
168389348391d10d5113fb186a.png";t.d(n,["A",0,o])},28453(e,n,t){t.d(n,{R:()=>s,x:()=>a});var o=t(96540);const r={},i=o.createContext(r);function s(e){const n=o.useContext(i);return o.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function a(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:s(e.components),o.createElement(i.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.