@goldensheepai/shep-lsp
v0.1.4
Published
Shep Language Server Protocol implementation
Readme
@goldensheepai/shep-lsp
Language Server Protocol implementation for ShepLang — IDE support for VS Code, Windsurf, and Cursor.
What is shep-lsp?
shep-lsp provides IDE features for ShepLang via the Language Server Protocol:
- Syntax Highlighting — Full TextMate grammar
- Diagnostics — Real-time error and warning messages
- Code Completion — Context-aware suggestions
- Hover Information — Type and documentation on hover
- Go to Definition — Jump to entity/field definitions
- Find References — Locate all usages
Installation
npm install @goldensheepai/shep-lspUsage
Standalone Server
import { startServer } from '@goldensheepai/shep-lsp';
// Start the LSP server on stdio
startServer();With VS Code Extension
The LSP is bundled with the ShepLang VS Code extension. Install it directly from the marketplace.
Features
Diagnostics
Real-time validation as you type:
Error: Unknown entity 'Usr' referenced in screen 'UserList'
Did you mean 'User'?
Warning: Field 'email' has no validation constraints
Consider adding (required) or other constraintsCode Completion
Context-aware suggestions:
data User {
email: | # suggests: text, number, boolean, date, money, enum(), ai()
}
view UserList {
show: [| # suggests: email, name, role (fields from User)
}Hover Information
data User {
email: text (required)
▲
│
└── Type: text
Constraints: required
Used in: UserList, UserDetail, CreateUserFlowGo to Definition
Ctrl+Click on any reference to jump to its definition.
Find References
Shift+F12 to find all usages of an entity, field, or screen.
Configuration
The server supports these initialization options:
{
"sheplang.validation.strict": false,
"sheplang.completion.snippets": true,
"sheplang.diagnostics.delay": 300
}Protocol Support
| Feature | Status | |---------|--------| | textDocument/didOpen | ✅ | | textDocument/didChange | ✅ | | textDocument/completion | ✅ | | textDocument/hover | ✅ | | textDocument/definition | ✅ | | textDocument/references | ✅ | | textDocument/publishDiagnostics | ✅ | | textDocument/formatting | 🚧 | | textDocument/rename | 🚧 |
Related Packages
- @goldensheepai/shep-core — Parser & verifier
- @goldensheepai/shep-cli — CLI tool
- @goldensheepai/shep-sheplang — TypeScript codegen
- @goldensheepai/shep-shepthon — Python codegen
License
MIT © Golden Sheep AI
