Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ Varlock is built on top of @env-spec, a new DSL for attaching a schema and addit
| [varlock](packages/varlock) | [![npm version](https://img.shields.io/npm/v/varlock.svg)](https://npmjs.com/package/varlock) |
| [@env-spec/parser](packages/env-spec-parser) | [![npm version](https://img.shields.io/npm/v/@env-spec/parser.svg)](https://npmjs.com/package/@env-spec/parser) |
| [@env-spec VSCode extension](packages/vscode-plugin) | [VSCode Marketplace](https://marketplace.visualstudio.com/items?itemName=varlock.env-spec-language), [Open VSX Registry](https://open-vsx.org/extension/varlock/env-spec-language) |
| [@env-spec Zed extension](packages/zed-plugin) | [Source](packages/zed-plugin), Zed extension gallery pending |
| [varlock Docker image](Dockerfile) | [GitHub Container Registry](https://github.com/orgs/dmno-dev/packages/container/package/varlock) |

### Plugins
Expand Down
6 changes: 6 additions & 0 deletions bun.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ export default tseslint.config(
'**/.turbo',
'packages/eslint-custom-rules',
'packages/env-spec-parser/src/grammar.js',
'packages/zed-plugin/target',
'packages/zed-plugin/server/package-lock.json',
'packages/zed-plugin/tree-sitter-varlock-schema',
'packages/varlock-website/.astro',
'packages/varlock/src/env-graph/test/plugins',
'**/*.ignore',
Expand Down Expand Up @@ -168,6 +171,7 @@ export default tseslint.config(
'packages/*.ignore/**',
'packages/varlock/src/cli/**',
'packages/varlock/scripts/**',
'packages/zed-plugin/scripts/**',
'smoke-tests/**',
'framework-tests/**',
'packages/encryption-binary-swift/scripts/**',
Expand All @@ -183,6 +187,13 @@ export default tseslint.config(
'@typescript-eslint/no-require-imports': 0,
},
},
{
files: ['packages/zed-plugin/server/src/**'],
rules: {
'@typescript-eslint/array-type': 0,
'no-use-before-define': 0,
},
},
{
// these files use build-time globals declared in globals.d.ts
files: [
Expand Down
1 change: 1 addition & 0 deletions packages/varlock-website/astro.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -222,6 +222,7 @@ export default defineConfig({
{ label: 'Reference', slug: 'env-spec/reference' },
// { label: 'Best practices', slug: 'env-spec/best-practices' },
{ label: 'VS Code extension', slug: 'env-spec/vs-code-ext' },
{ label: 'Zed extension', slug: 'env-spec/zed-ext' },
],
},
],
Expand Down
30 changes: 30 additions & 0 deletions packages/varlock-website/src/content/docs/env-spec/zed-ext.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
title: "@env-spec Zed extension"
description: "Syntax highlighting and language tooling for @env-spec enabled .env.schema files in Zed"
---

The @env-spec Zed extension provides language support for Varlock `.env.schema` files in Zed.

## Installation

The extension source lives in the [varlock monorepo](https://github.com/dmno-dev/varlock/tree/main/packages/zed-plugin). Once the Zed extension registry submission is approved, it will also be installable from Zed's extension gallery.

## Features

- `.env.schema` language registration
- Tree-sitter syntax highlighting for @env-spec comments and `.env.schema` values
- LSP-backed completions for decorators, `@type` values/options, resolver functions, `$KEY` references, and enum item values
- LSP-backed diagnostics for incompatible decorators, duplicate decorators, enum values, and static `@type` mismatches
- Hover info for known @decorators

## How to use this extension

After installing the extension, open a `.env.schema` file and set the language mode to `Varlock Schema`.

If you would like to have it autodetected by file type, add the following to your `settings.json` file in Zed's settings:

```json
"file_types": {
"Varlock Schema": [".env.schema", "*.env.schema"],
},
```
14 changes: 14 additions & 0 deletions packages/zed-plugin/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# Rust / Zed extension build output
/target
/extension.wasm

# Zed-managed grammar checkout + compiled grammar (rebuilt from extension.toml)
/grammars

# Language-server build artifacts
server/node_modules
server/out

# Local tooling
.claude/
.DS_Store
Loading