1"use strict";(self.webpackChunkclaude_hq=self.webpackChunkclaude_hq||[]).push([[1382],{42458:(e,n,i)=>{i.r(n),i.d(n,{assets:()=>h,contentTitle:()=>c,default:()=>g,frontMatter:()=>d,metadata:()=>s,toc:()=>u});const s=JSON.parse('{"id":"faqs/what-is-lsp-tool-in-claude-code","title":"What is LSP Tool in Claude Code","description":"Learn about the LSP (Language Server Protocol) tool in Claude Code: Enable go-to-definition, find references, and hover documentation for faster code navigation.","source":"@site/docs/faqs/what-is-lsp-tool-in-claude-code.md","sourceDirName":"faqs","slug":"/faqs/what-is-lsp-tool-in-claude-code","permalink":"/faqs/what-is-lsp-tool-in-claude-code","draft":false,"unlisted":false,"tags":[],"version":"current","lastUpdatedAt":1768857936000,"sidebarPosition":202,"frontMatter":{"sidebar_position":202,"date":"2026-01-19","image":"img/discovery/019.png","title":"What is LSP Tool in Claude Code","description":"Learn about the LSP (Language Server Protocol) tool in Claude Code: Enable go-to-definition, find references, and hover documentation for faster code navigation.","displayed_sidebar":"tutorialSidebar","hide_breadcrumbs":true},"sidebar":"tutorialSidebar"}');var t=i(74848),r=i(28453),a=i(33895),l=i(42219),o=i(5260);const d={sidebar_position:202,date:"2026-01-19",image:"img/discovery/019.png",title:"What is LSP Tool in Claude Code",description:"Learn about the LSP (Language Server Protocol) tool in Claude Code: Enable go-to-definition, find references, and hover documentation for faster code navigation.",displayed_sidebar:"tutorialSidebar",hide_breadcrumbs:!0},c="What is the LSP Tool in Claude Code",h={},u=[{value:"How to Enable LSP",id:"how-to-enable-lsp",level:3},{value:"Core LSP Operations",id:"core-lsp-operations",level:3},{value:"Installing Language Server Plugins",id:"installing-language-server-plugins",level:3},{value:"Supported Languages",id:"supported-languages",level:3}];function p(e){const n={a:"a",admonition:"admonition",code:"code",h1:"h1",h3:"h3",header:"header",hr:"hr",li:"li",ol:"ol",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,r.R)(),...e.components};return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(o.A,{children:(0,t.jsx)("script",{type:"application/ld+json",children:JSON.stringify({"@context":"https://schema.org","@type":"FAQPage",mainEntity:[{"@type":"Question",name:"What is the LSP tool in Claude Code?",acceptedAnswer:{"@type":"Answer",text:"The LSP (Language Server Protocol) tool provides IDE-level code intelligence in Claude Code, enabling go-to-definition, find references, hover documentation, and real-time diagnostics."}},{"@type":"Question",name:"How do I enable LSP in Claude Code?",acceptedAnswer:{"@type":"Answer",text:"Set the environment variable ENABLE_LSP_TOOL=1. For a single session use 'ENABLE_LSP_TOOL=1 claude', or add 'export ENABLE_LSP_TOOL=1' to your shell profile for permanent enablement."}}]})})}),"\n",(0,t.jsx)(l.A,{breadcrumbs:[{label:"FAQs",href:"/faq"},{label:"What is the LSP Tool",href:"/faqs/what-is-lsp-tool-in-claude-code"}],currentPage:"What is the LSP Tool"}),"\n",(0,t.jsx)(n.header,{children:(0,t.jsx)(n.h1,{id:"what-is-the-lsp-tool-in-claude-code",children:"What is the LSP Tool in Claude Code"})}),"\n",(0,t.jsxs)(n.p,{children:["The LSP (Language Server Protocol) tool in Claude Code provides IDE-level code intelligence features. Introduced in ",(0,t.jsx)(n.code,{children:"v2.0.74"}),", it enables go-to-definition, find references, hover documentation, and real-time diagnostics\u2014the same capabilities your IDE uses."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(a.Ay,{}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"how-to-enable-lsp",children:"How to Enable LSP"}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Temporary (single session):"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"ENABLE_LSP_TOOL=1 claude\n"})}),"\n",(0,t.jsx)(n.p,{children:(0,t.jsx)(n.strong,{children:"Permanent (add to shell profile):"})}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"# Add to ~/.bashrc, ~/.zshrc, or equivalent\nexport ENABLE_LSP_TOOL=1\n"})}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"core-lsp-operations",children:"Core LSP Operations"}),"\n",(0,t.jsx)(n.p,{children:"The LSP tool provides five operations:"}),"\n",(0,t.jsxs)(n.table,{children:[(0,t.jsx)(n.thead,{children:(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.th,{children:"Operation"}),(0,t.jsx)(n.th,{children:"Description"})]})}),(0,t.jsxs)(n.tbody,{children:[(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"goToDefinition"})}),(0,t.jsx)(n.td,{children:"Jump to where a symbol is defined"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"findReferences"})}),(0,t.jsx)(n.td,{children:"Locate all usages of a function/variable"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"documentSymbol"})}),(0,t.jsx)(n.td,{children:"View file structure (classes, functions)"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"hover"})}),(0,t.jsx)(n.td,{children:"Display type information and documentation"})]}),(0,t.jsxs)(n.tr,{children:[(0,t.jsx)(n.td,{children:(0,t.jsx)(n.code,{children:"getDiagnostics"})}),(0,t.jsx)(n.td,{children:"Real-time error and warning detection"})]})]})]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"installing-language-server-plugins",children:"Installing Language Server Plugins"}),"\n",(0,t.jsx)(n.p,{children:"LSP requires language-specific plugins from a marketplace:"}),"\n",(0,t.jsxs)(n.ol,{children:["\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Add the LSP marketplace:"}),"\n",(0,t.jsx)(n.pre,{children:(0,t.jsx)(n.code,{className:"language-bash",children:"/plugin marketplace add Piebald-AI/claude-code-lsps\n"})}),"\n"]}),"\n",(0,t.jsxs)(n.li,{children:["\n",(0,t.jsx)(n.p,{children:"Install plugins via UI:"}),"\n",(0,t.jsxs)(n.ul,{children:["\n",(0,t.jsxs)(n.li,{children:["Run ",(0,t.jsx)(n.code,{children:"/plugins"})]}),"\n",(0,t.jsxs)(n.li,{children:["Navigate to ",(0,t.jsx)(n.strong,{children:"Marketplaces"})," \u2192 ",(0,t.jsx)(n.strong,{children:"claude-code-lsps"})]}),"\n",(0,t.jsx)(n.li,{children:"Select desired language servers (Python/pyright, TypeScript/vtsls, Go/gopls, etc.)"}),"\n",(0,t.jsxs)(n.li,{children:["Press ",(0,t.jsx)(n.code,{children:"i"})," to install"]}),"\n"]}),"\n"]}),"\n"]}),"\n",(0,t.jsxs)(n.p,{children:[(0,t.jsx)(n.strong,{children:"Note:"})," You must also install the language server binary separately (e.g., ",(0,t.jsx)(n.code,{children:"npm install -g pyright"})," for Python)."]}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.h3,{id:"supported-languages",children:"Supported Languages"}),"\n",(0,t.jsx)(n.p,{children:"LSP plugins are available for 14+ languages including Python, TypeScript, JavaScript, Go, Rust, Java, C, C++, C#, PHP, Kotlin, Ruby, PowerShell, and HTML/CSS."}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsx)(n.admonition,{title:"Image Tip:/img/discovery/019.png|IDE-Level Code Intelligence",type:"tip",children:(0,t.jsx)(n.p,{children:"LSP provides semantic code understanding for navigating large codebase
1s, finding references before refactoring, and catching errors with real-time diagnostics."})}),"\n",(0,t.jsx)(n.admonition,{title:"AdSense In-Article Ad White Low",type:"tip"}),"\n",(0,t.jsx)(n.hr,{}),"\n",(0,t.jsxs)(n.p,{children:["See Also: ",(0,t.jsx)(n.a,{href:"/faqs/what-is-plugins-system-in-claude-code",children:"Plugins System"}),(0,t.jsx)("span",{className:"see-also-divider",children:"|"}),(0,t.jsx)(n.a,{href:"/faqs/what-are-claude-code-best-practices",children:"Claude Code Best Practices"})]})]})}function g(e={}){const{wrapper:n}={...(0,r.R)(),...e.components};return n?(0,t.jsx)(n,{...e,children:(0,t.jsx)(p,{...e})}):p(e)}}}]);
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.