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.
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 diagnosticsIntelligent completionsRun code in StataSyntax highlighting with nesting depth colors
Installation
Search for "Sight" in the extension marketplace and click Install, or download the extension from Releases.