fix(lsp): read env names from the vault env files - #24
Merged
Conversation
gandarfh
force-pushed
the
feat/env-names-from-vault
branch
from
June 12, 2026 01:31
c4bda5a to
25289cc
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Environments migrated from the app database to file-backed storage (/envs/.toml + active env in the per-machine user.toml), which left the LSP reading an empty table — env name completion and hover enrichment silently disappeared.
The server now discovers the vault root by walking up from the document path to the nearest directory containing envs/, reads the active env name for that vault from user.toml (XDG_CONFIG_HOME, then the platform config dir), and extracts variable NAMES from [vars] and [secrets] (plus the .local.toml override). Values never leave the module — and [secrets] values are keychain references by contract, so secret material is not even on disk there.
New opam dependency: toml (quoted path keys in [active_envs] rule out hand parsing).
Integration fixture switched from sqlite env tables to a temp vault + XDG_CONFIG_HOME override; covers the .local merge and inactive-env exclusion (107 checks).