Editor support for PromptL - a templating language for LLM prompts.
Built with ❤️ by Latitude
- Syntax Highlighting - Full syntax support for PromptL files
- Real-time Diagnostics - Catch errors as you type
- Go to Definition - Navigate to referenced prompts with Cmd+Click
- Hover Information - See details about referenced files
- Reference Validation - Ensure all
<prompt path="...">references exist
| Package | Description |
|---|---|
| promptl-lsp | Language Server Protocol implementation |
| promptl-vscode | VS Code extension |
| promptl-vim | Vim/Neovim plugin |
From Marketplace (recommended):
Install from the VS Code Marketplace or search for "PromptL" in VS Code extensions.
From .vsix file:
code --install-extension promptl-vscode-0.1.0.vsixOpen VS Code settings and search for "promptl", or add to your settings.json:
{
"promptl.diagnostics.enable": true,
"promptl.diagnostics.validateReferences": true
}| Setting | Default | Description |
|---|---|---|
promptl.diagnostics.enable |
true |
Enable real-time diagnostics |
promptl.diagnostics.validateReferences |
true |
Validate <prompt path="..."> references |
- Open this repository in VS Code
- Press
F5(or Run > Start Debugging) - A new VS Code window opens with the extension loaded
- Open any
.promptlfile from theexamples/folder
To package and install locally:
cd packages/vscode
pnpm build
pnpm package
code --install-extension promptl-vscode-0.1.0.vsix| Feature | How to Test |
|---|---|
| Syntax highlighting | Open any .promptl file - tags, expressions, YAML should be colored |
| Diagnostics | Add {{ if true }} without {{ endif }} - should show error |
| Go to Definition | Cmd+Click on path="..." in <prompt path="./other.promptl"> |
| Hover | Hover over a prompt path to see file information |
{
'latitude-dev/promptl',
config = function()
require('promptl').setup()
end,
}use {
'latitude-dev/promptl',
config = function()
require('promptl').setup()
end,
}Plug 'latitude-dev/promptl'For Neovim, add to your init.lua:
require('promptl').setup()Copy the plugin files to your config directory:
# For Neovim
cp -r packages/vim/* ~/.config/nvim/
# For Vim
cp -r packages/vim/ftdetect ~/.vim/
cp -r packages/vim/ftplugin ~/.vim/
cp -r packages/vim/syntax ~/.vim/The LSP server provides diagnostics, go-to-definition, and hover. Install it globally:
npm install -g promptl-lspOr if developing locally, link it:
cd packages/lsp
pnpm build
npm linkrequire('promptl').setup({
-- Optional: custom path to LSP server
cmd = { 'promptl-lsp', '--stdio' },
-- Diagnostics settings
diagnostics = {
enable = true,
validate_references = true,
},
})- Build the LSP server:
pnpm build:lsp- Add to your Neovim config (temporary for testing):
-- Add plugin to runtimepath
vim.opt.runtimepath:append('/path/to/promptl-vscode/packages/vim')
-- Setup with local LSP server
require('promptl').setup({
cmd = { 'node', '/path/to/promptl-vscode/packages/lsp/out/server.js', '--stdio' },
})- Open a
.promptlfile:
nvim examples/basic/simple.promptl| Feature | How to Test |
|---|---|
| Syntax highlighting | Open any .promptl file - should see colors |
| Diagnostics | :LspInfo should show promptl attached, errors appear inline |
| Go to Definition | gd on a prompt path reference |
| Hover | K on a prompt path to see file info |
Vim users get syntax highlighting out of the box. For LSP support, use a plugin like:
- Node.js >= 18
- pnpm >= 9
# Install dependencies
pnpm install
# Build all packages
pnpm build
# Watch for changes
pnpm watch# Build only the LSP server
pnpm build:lsp
# Build only the VS Code extension
pnpm build:vscode
# Package the VS Code extension
pnpm package:vscodepromptl-editors/
├── packages/
│ ├── lsp/ # Language Server Protocol server
│ │ ├── src/
│ │ │ ├── server.ts # LSP entry point
│ │ │ ├── handlers/ # LSP capability handlers
│ │ │ │ ├── diagnostics.ts
│ │ │ │ ├── definition.ts
│ │ │ │ ├── hover.ts
│ │ │ │ └── documentLink.ts
│ │ │ └── utils/
│ │ │ └── references.ts
│ │ └── bin/
│ │ └── promptl-lsp # CLI executable
│ │
│ ├── vscode/ # VS Code extension
│ │ ├── src/
│ │ │ └── extension.ts # Extension entry (LSP client)
│ │ ├── syntaxes/ # TextMate grammar
│ │ └── icons/
│ │
│ └── vim/ # Vim/Neovim plugin
│ ├── ftdetect/ # File type detection
│ ├── ftplugin/ # File type settings
│ ├── syntax/ # Vim syntax highlighting
│ └── lua/ # Neovim LSP configuration
│
├── examples/ # Example PromptL files
├── package.json # Workspace root
└── pnpm-workspace.yaml
The core intelligence lives in the LSP server (promptl-lsp), which provides:
- Diagnostics (using the
promptl-aiparser) - Go to Definition
- Hover information
- Document links
Editor-specific packages are thin clients that connect to the LSP:
- VS Code: Uses
vscode-languageclientto start and communicate with the LSP - Neovim: Uses built-in LSP client (
vim.lsp.start) - Vim: Requires an LSP plugin like
vim-lsporcoc.nvim
This architecture means new features only need to be implemented once in the LSP server.
- PromptL - The PromptL language itself
- Latitude - Open source platform for scaling AI products (where PromptL originated)
MIT