@jbearak/sight 0.8.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +675 -0
- package/README.md +113 -0
- package/dist/sight-server.js +66695 -0
- package/package.json +90 -0
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# Sight
|
|
2
|
+
|
|
3
|
+
Sight is a static analyzer and language server for the Stata statistical programming language. It resolves what's in scope at each line — catching undefined macros and used-before-defined references even in a single script, and across files by following `do`/`run`/`include` chains — without running your code. Sight ships as an extension for [VS Code](https://github.com/Microsoft/vscode), bringing real-time diagnostics and code intelligence to your editor as you type; it also runs as a standalone [Language Server Protocol (LSP)](https://github.com/Microsoft/language-server-protocol) server for other editors and headlessly via `sight check` for automated checks in CI.
|
|
4
|
+
|
|
5
|
+
> **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 `do` and `include` chains, Sight helps you catch errors *before* you run your code.
|
|
6
|
+
|
|
7
|
+
> **Status:** Sight is under active development. It works well for day-to-day use but hasn't been widely announced yet. Bug reports and feedback are welcome!
|
|
8
|
+
|
|
9
|
+
> **Quick Start:** Install from the [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=jbearak.sight) or [OpenVSX](https://open-vsx.org/extension/jbearak/sight), or download the `.vsix` from the [releases page](https://github.com/jbearak/sight/releases). See [Installation](#installation) for other methods.
|
|
10
|
+
|
|
11
|
+
Sight's sister project [Raven](https://github.com/jbearak/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.
|
|
12
|
+
|
|
13
|
+
## Features
|
|
14
|
+
|
|
15
|
+
### Language Server:
|
|
16
|
+
|
|
17
|
+
- **[Diagnostics](docs/diagnostics.md)**: Real-time syntax error detection and undefined macro warnings
|
|
18
|
+
- **[Code Completion](docs/completion.md)**: Context-aware completions for commands, options, macros, and variables
|
|
19
|
+
- **Go-to-Definition**: Jump to definitions of local/global macros and programs across the workspace
|
|
20
|
+
- **[Find References](docs/find-references.md)**: Locate every use of a macro, program, or variable across related files
|
|
21
|
+
- **[Cross-file awareness](docs/cross-file.md)**: Symbol resolution across `do`/`include` chains with position-aware scope
|
|
22
|
+
- **[Declaration directives](docs/declaration-directives.md)**: Suppress diagnostics for dynamically-created symbols (`@lsp-local`, `@lsp-global`)
|
|
23
|
+
- **[Document Outline](docs/document-outline.md)**: Hierarchical code navigation with programs, macros, variables, and code sections
|
|
24
|
+
- **Workspace Symbols**: Search for symbols across the entire workspace
|
|
25
|
+
|
|
26
|
+
### Editor Extension:
|
|
27
|
+
|
|
28
|
+
The editor extension enables language server features and further provides:
|
|
29
|
+
|
|
30
|
+
- **[Run Code](docs/send-to-stata.md)**: Execute code in the Stata application or terminal with intelligent statement detection and working directory management
|
|
31
|
+
- **[Syntax Highlighting](docs/syntax-highlighting.md)**: Rich syntax highlighting with unique features like macro/string nesting depth coloring
|
|
32
|
+
- **[Auto-Closing Pairs](docs/quote-auto-close.md)**: Intelligently handles Stata's unique conventions for nested macros and compound strings
|
|
33
|
+
- **[Data Browser](docs/data-browser.md)**: 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. In console Stata, `browse` (and its abbreviations `brows`/`brow`/`bro`/`br`) works as an alias for `vview` (the GUI's built-in `browse` is unaffected)
|
|
34
|
+
- **[Log Viewer](docs/log-viewer.md)**: Render Stata log files (`.smcl`) with formatted output directly in VS Code
|
|
35
|
+
- **[Help Viewer](docs/help-viewer.md)**: Read Stata help files (`.sthlp`) directly in VS Code with clickable help-topic links
|
|
36
|
+
- **[Code Formatting](docs/formatting.md)** (experimental): Format `.do` files and normalize comment styles
|
|
37
|
+
|
|
38
|
+
## Documentation
|
|
39
|
+
|
|
40
|
+
### Guides
|
|
41
|
+
|
|
42
|
+
- [Configuration](docs/configuration.md) - All settings and options
|
|
43
|
+
- [CLI](docs/cli.md) - `sight check` for CI and command-line diagnostics
|
|
44
|
+
- [Standalone Installation](docs/standalone-installation.md) - CLI usage, release binary, build from source
|
|
45
|
+
- [Editor Integrations](docs/editor-integrations.md) - Generic LSP clients, AI agents
|
|
46
|
+
- [Neovim Setup](docs/neovim-setup.md) - Configure Sight for Neovim
|
|
47
|
+
|
|
48
|
+
Per-feature reference pages live in [`docs/`](docs) and are linked from
|
|
49
|
+
most entries in [Features](#features) above.
|
|
50
|
+
|
|
51
|
+
### Examples
|
|
52
|
+
|
|
53
|
+
#### Undefined local macro
|
|
54
|
+
|
|
55
|
+
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.
|
|
56
|
+
<img width="683" height="390" alt="Undefined local macro diagnostic" src="examples/undefined_local.png"/>
|
|
57
|
+
|
|
58
|
+
#### Command completion
|
|
59
|
+
<img width="615" height="420" alt="Command completion popup" src="examples/command_completion.png"/>
|
|
60
|
+
|
|
61
|
+
#### Syntax highlighting
|
|
62
|
+
|
|
63
|
+
Sight colorizes nesting depth of compound strings and local macros.
|
|
64
|
+
|
|
65
|
+
<img width="581" height="386" alt="Syntax highlighting with nesting depth colors (dark theme)" src="examples/nested_locals_within_compound_strings_dark.png"/>
|
|
66
|
+
<img width="581" height="386" alt="Syntax highlighting with nesting depth colors (light theme)" src="examples/nested_locals_within_compound_strings_light.png"/>
|
|
67
|
+
|
|
68
|
+
#### Send to Stata
|
|
69
|
+
|
|
70
|
+
Execute code in Stata directly from the editor.
|
|
71
|
+
<img width="641" height="565" alt="Send to Stata menu" src="examples/send_to_stata_menu.png"/>
|
|
72
|
+
|
|
73
|
+
> See the [Examples Gallery](docs/examples.md) for more screenshots.
|
|
74
|
+
|
|
75
|
+
## Installation
|
|
76
|
+
|
|
77
|
+
### From Extension Registry
|
|
78
|
+
|
|
79
|
+
- [VS Code Marketplace](https://marketplace.visualstudio.com/items?itemName=jbearak.sight)
|
|
80
|
+
- [OpenVSX Registry](https://open-vsx.org/extension/jbearak/sight)
|
|
81
|
+
|
|
82
|
+
### From VSIX
|
|
83
|
+
|
|
84
|
+
1. Download the latest `.vsix` from the [releases page](https://github.com/jbearak/sight/releases)
|
|
85
|
+
2. In VS Code:
|
|
86
|
+
- Extensions → `...` menu → "Install from VSIX..."
|
|
87
|
+
- Or via CLI: `code --install-extension sight-<version>.vsix`
|
|
88
|
+
|
|
89
|
+
> **Note:** If you have other extensions installed that provide Stata syntax highlighting (e.g., `stata-enhanced` or `stata-language`), disable them to use Sight's syntax highlighting.
|
|
90
|
+
|
|
91
|
+
### From npm
|
|
92
|
+
|
|
93
|
+
For command-line use or editors that connect to an external LSP server:
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
npm install -g @jbearak/sight
|
|
97
|
+
sight --help
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
### Other Methods
|
|
101
|
+
|
|
102
|
+
- **Standalone CLI / Build from Source**: See [Standalone Installation](docs/standalone-installation.md)
|
|
103
|
+
- **Other Editors & AI Agents**: See [Editor Integrations](docs/editor-integrations.md)
|
|
104
|
+
- **Neovim**: See [Neovim Setup Guide](docs/neovim-setup.md)
|
|
105
|
+
|
|
106
|
+
## Development
|
|
107
|
+
|
|
108
|
+
See [Development Notes](DEVELOPMENT.md) for build instructions, testing, and release process.
|
|
109
|
+
|
|
110
|
+
## License
|
|
111
|
+
|
|
112
|
+
Copyright © 2026 Jonathan Marc Bearak
|
|
113
|
+
[GPLv3](LICENSE) - 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.
|