Sight
Sight is a static analyzer and language server for Stata, built for VS Code. It resolves what's in scope at each line — catching undefined macros and used-before-defined references within a script and across do/run/include chains, without running your code — and surfaces that as real-time diagnostics, completions, go-to-definition, and find-references as you type. It also runs your code in Stata and ships built-in viewers for datasets, logs, and help files.
Features
- Real-time Diagnostics: Catch undefined macros and other issues as you type
- Intelligent Completions: 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
- Run Code in Stata: Execute code in the Stata application or terminal with intelligent statement detection and working directory management
- Syntax Highlighting: Rich highlighting with nesting depth colors for compound strings and nested macros
- Auto-Closing Pairs: Intelligently handles Stata's unique conventions for nested macros and compound strings
- Cross-File Awareness: Symbol resolution across
do/run/include chains with position-aware scope. Works automatically for most projects; some edge cases (e.g., dynamic macro paths or files outside the workspace) require manual configuration.
- 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
- Data Browser: Open
.dta files directly in VS Code, or call vview from Stata to send the current dataset to the editor — features a virtualized grid with column resizing/hiding and value labels
- Log Viewer: Render Stata
.smcl log files with formatted output directly in VS Code
- Help Viewer: Read Stata
.sthlp help files directly in VS Code with clickable help-topic links
Screenshots
Real-time diagnostics
Intelligent completions
Run code in Stata
Syntax highlighting with nesting depth colors
Installation
Search for "Sight" in the extension marketplace and click Install, or download the extension from Releases.
To try new features before a stable release, click Switch to Pre-Release Version on this extension's page. Starting with 0.17, pre-releases have an odd minor version (0.17, 0.19) and stable releases an even one. You get the newest version from either channel, so a newer stable release replaces an older pre-release.
Documentation
For full documentation, configuration options, and LSP directives, see the full documentation on GitHub.
License
Copyright (c) 2026 Jonathan Marc Bearak. Licensed under GPLv3.