Stata - Stata Language Server
Comprehensive language support for Stata: real-time diagnostics, completions, go-to-definition, find references, run code in Stata, syntax highlighting with nesting depth colors, code formatting, cross-file symbol resolution, and 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.
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.