An open source Language Server Protocol (LSP) implementation for the Stata statistical programming language, with a corresponding extension for VS Code.
tl;dr: Sight brings modern IDE superpowers to Stata coding. It goes far beyond syntax highlighting, using semantic analysis to provide workspace-wide symbol resolution and intelligent macro tracking. With features like Go-to-Definition, Autocomplete, and Real-time Diagnostics that trace execution through
doandincludechains, Sight helps you catch errors before you run your code.
Development Status: Sight is an early-stage implementation. While functional, it requires substantial testing and code review. Contributions and feedback are welcome!
Quick Start: Install from the VS Code Marketplace or OpenVSX, or download the
.vsixfrom the releases page. See Installation for other methods.
Sight provides Stata language support for VS Code, its forks (Antigravity, Cursor, Kiro, Positron, and Windsurf), and Zed. This repository, Sight, contains the language server, editor extension, and TextMate grammar. The corresponding Zed extension is in zed-stata, and the tree-sitter grammar is in tree-sitter-stata. Like the language server, the grammar can be used in any editor.
Sight's sister project Raven implements a language server for R. Together they bring cross-file navigation, error detection, and code intelligence to two languages widely used in social science research.
- Diagnostics: Real-time syntax error detection and undefined macro warnings
- Code Completion: Context-aware completions for commands, options, macros, and variables
- Go-to-Definition: Jump to definitions of local/global macros and programs across the workspace
- Find References: Locate every use of a macro, program, or variable across related files
- Cross-file awareness: Symbol resolution across
do/includechains with position-aware scope - Declaration directives: Suppress diagnostics for dynamically-created symbols (
@lsp-local,@lsp-global) - Document Outline: Hierarchical code navigation with programs, macros, variables, and code sections
- Workspace Symbols: Search for symbols across the entire workspace
The editor extension enables language server features and further provides:
- Run Code: Execute code in the Stata application or terminal with intelligent statement detection and working directory management
- Syntax Highlighting: Rich syntax highlighting with unique features like macro/string nesting depth coloring
- Auto-Closing Pairs: Intelligently handles Stata's unique conventions for nested macros and compound strings
- Data Browser: Open
.dtafiles directly in VS Code, or callvviewfrom Stata to send the current dataset to the editor — features a virtualized grid with column resizing/hiding and value labels - Log Viewer: Render Stata log files (
.smcl) with formatted output directly in VS Code - Help Viewer: Read Stata help files (
.sthlp) directly in VS Code with clickable help-topic links - Code Formatting (experimental): Format
.dofiles and normalize comment styles
- Configuration - All settings and options
- Standalone Installation - CLI usage, npm/npx, build from source
- Editor Integrations - Generic LSP clients, AI agents
- Neovim Setup - Configure Sight for Neovim
Per-feature reference pages live in docs/ and are linked from
most entries in Features above.
Stata would evaluate `froot' to "" because of the misspelling. In this example, it affects the displayed text. When combined with if-then-else statements, this leads to unexpected control flow.

Sight colorizes nesting depth of compound strings and local macros.
Execute code in Stata directly from the editor.

See the Examples Gallery for more screenshots.
- Download the latest
.vsixfrom the releases page - In VS Code:
- Extensions →
...menu → "Install from VSIX..." - Or via CLI:
code --install-extension sight-client-<version>.vsix
Note: If you have other extensions installed that provide Stata syntax highlighting (e.g.,
stata-enhancedorstata-language), disable them to use Sight's syntax highlighting.
- Standalone CLI / Build from Source: See Standalone Installation
- Other Editors & AI Agents: See Editor Integrations
- Neovim: See Neovim Setup Guide
See Development Notes for build instructions, testing, and release process.
Copyright © 2026 Jonathan Marc Bearak GPLv3 - This project is open source software. You can use, modify, and distribute it with attribution, but any derivative works must also be open source under GPLv3.


