# 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 ```mlf 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 ```bash # 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: ```bash # 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: ```json { "languageServer": { "module": "/path/to/mlf-lsp", "args": [], "filetypes": ["mlf"] } } ``` **Neovim**: Add to your LSP config: ```lua 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`: ```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](mlf-lsp/README.md) for more details. ## Documentation Visit the [MLF website](https://mlf.lol/docs) for comprehensive documentation, guides, and examples. ## Architecture Please review [ARCHITECTURE.md](ARCHITECTURE.md) for an overview of how the project is structured. ## License MIT