XPath Copier for VS CodeXPath Copier is a Visual Studio Code extension that makes it simple to generate and copy XPaths for elements in XML‑like documents. It works with XML, HTML and XHTML files (or any other languages you configure) and offers several formats including full paths with indexes, compact paths without unnecessary indexes, name‑based paths and human‑readable breadcrumbs. A unified Quick Pick makes it easy to choose a format on the fly, and a reverse command lets you paste an XPath and jump directly to the referenced element. Features🧩 Copy XPaths in Multiple FormatsSix built‑in formats are supported:
You can trigger any of these commands directly from the Command Palette, a context menu in the editor or via optional keybindings. A single “XPath: Copy…” command displays a Quick Pick where you can choose the desired format. 📄 Paste & GoThe “XPath: Go To…” command lets you paste an XPath string (such as one that was generated previously) and the extension will move the cursor to the matching element. If no element matches the path, you will be notified. 🔍 Multi‑Cursor FriendlyWhen you have multiple selections or cursors active, XPath Copier will generate a list of XPaths. You can choose whether multiple results are joined with newlines or encoded as a JSON array via the 🧠 Uses the LemMinX XML Language Server via Red Hat's XML Extension for Accurate PathsXPath Copier relies on VS Code’s document symbol provider (powered by the Red Hat XML Language Server) to understand the structure of your document. Make sure you have an XML language server installed and running—such as redhat.vscode‑xml or another extension that provides XML support. If no language server is available the extension will warn you on activation and immediately disable itself. ⚙️ ConfigurationSettings can be adjusted in your user or workspace settings under the
See 🧪 TestingUnit tests live in the
🔨 Building & PackagingThe source code lives under
This uses the 📦 Icon & LicenceThe file Known Limitations
ContributingPull requests and issues are welcome! Please provide detailed steps to reproduce any problems, along with example input files when applicable. |