| Crates.io | ecolog-lsp |
| lib.rs | ecolog-lsp |
| version | 0.2.4 |
| created_at | 2026-01-13 12:31:29.228749+00 |
| updated_at | 2026-01-25 17:15:44.418872+00 |
| description | Language Agnostic LSP for Environment Variables |
| homepage | |
| repository | |
| max_upload_size | |
| id | 2040032 |
| size | 1,143,215 |
A language-agnostic Language Server Protocol (LSP) implementation for environment variables, providing intelligent code assistance for environment variable references across multiple programming languages.
.env filesEach language has custom tree-sitter queries to accurately detect environment variable access patterns specific to that language's idioms.
cargo build --release
The compiled binary will be available at target/release/ecolog-lsp.
The LSP can be configured via an ecolog.toml file in your workspace root. If no configuration file is found, sensible defaults are used.
[workspace]
env_files = [".env", ".env.local", ".env.development"]
[features]
completion = true
hover = true
definition = true
diagnostics = true
semantic_tokens = true
[masking]
enabled = true
# Mask values in hover tooltips for security
mask_in_hover = true
mask_in_completion = false
[interpolation]
enabled = true
max_depth = 10
[cache]
enabled = true
hot_cache_size = 100
ttl = 300
[workspace]env_files: Array of environment file paths to load (relative to workspace root)[features]completion: Enable/disable auto-completionhover: Enable/disable hover informationdefinition: Enable/disable go-to-definitiondiagnostics: Enable/disable diagnosticssemantic_tokens: Enable/disable semantic token highlighting[masking]enabled: Master switch for value maskingmask_in_hover: Mask sensitive values in hover tooltipsmask_in_completion: Mask values in completion items[interpolation]enabled: Support variable interpolation (e.g., ${VAR} syntax)max_depth: Maximum nesting depth for interpolated variables[cache]enabled: Enable caching of resolved valueshot_cache_size: Number of frequently accessed variables to cachettl: Cache time-to-live in secondsAdd to your settings.json:
{
"ecolog-lsp.enable": true,
"ecolog-lsp.serverPath": "/path/to/ecolog-lsp"
}
Or install via a VSCode extension if available.
Using nvim-lspconfig:
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
if not configs.ecolog then
configs.ecolog = {
default_config = {
cmd = {'/path/to/ecolog-lsp'},
filetypes = {'javascript', 'typescript', 'python', 'rust', 'lua', 'go'},
root_dir = lspconfig.util.root_pattern('.env', '.git'),
settings = {},
},
}
end
lspconfig.ecolog.setup{}
The LSP server communicates via stdin/stdout, so it can be integrated with any editor that supports the Language Server Protocol. Refer to your editor's LSP client documentation.
Ecolog LSP is built on several core components:
.env files and code filescargo test
RUST_LOG=debug cargo run
ecolog-lsp/
├── src/
│ ├── analysis/ # AST analysis and binding resolution
│ ├── languages/ # Language-specific parsers and queries
│ ├── server/ # LSP server implementation
│ └── types.rs # Core type definitions
├── queries/ # Tree-sitter query files per language
├── tests/ # Integration and unit tests
└── Cargo.toml
See LICENSE file for details.
Contributions are welcome! Please ensure tests pass before submitting pull requests.
cargo test
cargo fmt
cargo clippy