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.
- Code Completion: Context-aware completions for commands, options, macros, and variables
- Diagnostics: Real-time syntax error detection and undefined macro warnings
- Go-to-Definition: Jump to definitions of local/global macros and programs across the workspace
- Document Outline: Hierarchical code navigation with programs, macros, variables, and code sections
- Workspace Symbols: Search for symbols across the entire workspace
- Cross-file awareness: Symbol resolution across
do/includechains with position-aware scope - Declaration directives: Suppress diagnostics for dynamically-created symbols (
@lsp-local,@lsp-global)
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
- Quote Auto-Close: Intelligently handles Stata's unique conventions for nested macros and compound strings
- 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
- Document Outline - Hierarchical code navigation with sections, programs, and macros
- Cross-File Awareness - Workspace indexing, directives, scope resolution
- Declaration Directives -
@lsp-local,@lsp-globalfor dynamically-created symbols - Send to Stata - Execute code in Stata from VS Code or terminal
- Quote Auto-Close - Intelligent auto-closing for Stata quoting conventions
- Formatting - Code formatting and comment normalization (experimental)
- Syntax Highlighting - TextMate scopes, nesting depth colors
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
- Extensions →
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. Extensions likestataRun(which launches Stata from VS Code) can remain enabled.
- 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.


