Matt's Lexicon Format#
A human-friendly DSL for ATProto Lexicons
This is a work in progress, things are subject to break and change
What it looks like#
record post {
text!: string constrained {
maxLength: 3000,
maxGraphemes: 300,
},
createdAt!: Datetime,
reply: replyRef,
}
def type replyRef = {
root!: com.atproto.repo.strongRef,
parent!: com.atproto.repo.strongRef,
};
Installation#
Right now you can only install mlf from source:
CLI Tool#
# Install with all code generators (default: TypeScript, Go, Rust)
cargo install --path mlf-cli --all-features
# Install with only specific generators
cargo install --path mlf-cli --no-default-features --features typescript,go
# Install with JSON generation only
cargo install --path mlf-cli --no-default-features
Language Server#
For editor integration with real-time diagnostics:
# Build the language server
cargo build --release -p mlf-lsp
# The binary will be at: target/release/mlf-lsp
Editor Setup#
VS Code: Create an extension configuration:
{
"languageServer": {
"module": "/path/to/mlf-lsp",
"args": [],
"filetypes": ["mlf"]
}
}
Neovim: Add to your LSP config:
local lspconfig = require('lspconfig')
local configs = require('lspconfig.configs')
configs.mlf = {
default_config = {
cmd = { '/path/to/mlf-lsp' },
filetypes = { 'mlf' },
root_dir = lspconfig.util.root_pattern('mlf.toml', '.git'),
},
}
lspconfig.mlf.setup{}
Helix: Add to languages.toml:
[[language]]
name = "mlf"
scope = "source.mlf"
file-types = ["mlf"]
language-servers = ["mlf-lsp"]
[language-server.mlf-lsp]
command = "/path/to/mlf-lsp"
See mlf-lsp/README.md for more details.
Documentation#
Visit the MLF website for comprehensive documentation, guides, and examples.
Architecture#
Please review ARCHITECTURE.md for an overview of how the project is structured.
License#
MIT