lsp
- Repo stars 3,367
- License MIT
- Author updated Live
- Author repo atopile
- Domain
- Other
- Compatible agents
-
- Claude Code
- Cursor
- Cline
- Codex
- Windsurf
- Gemini CLI
- +20
- Trust score
- 94 / 100 · audit passed
- Author / version / license
- @atopile · MIT
- Token usage
- Lean
- Setup complexity
- Guided setup
- External API key
- Not required
- Operating systems
- Unspecified (assume cross-platform)
- Runtime requirements
- Python
- Permissions
-
- Read-only
- Write / modify
- Shell exec
- Network behavior
- Local-only
- Install commands
- 26 variants
Profile is derived at build time from SKILL.md and install vectors. Subject to drift from author intent.
Heads up: 未限定 allowed-tools,默认拥有全部工具权限。
---
name: lsp
description: How the atopile Language Server works (pygls), how it builds per-document graphs for completion/…
category: other
runtime: Python
---
# lsp output preview
## PART A: Task fit
- Use case: How the atopile Language Server works (pygls), how it builds per-document graphs for completion/hover/defs, and the invariants for keeping it fast and crash-proof. The lsp module (located in src/atopile/lsp/) implements the Language Server Protocol for atopile. It provides IDE features like autocomplete, go-to-definition, and diagnostics (error reporting)….
- Inputs: target material, constraints, expected output, and acceptance criteria.
- Evidence boundary: follow “Quick Start / Relevant Files / Dependants (Call Sites)” and do not present inference as author intent.
## PART B: Execution result
- **01** The card summarizes the use case; runtime output centers on “How the atopile Language Server works (pygls), how it builds per-document graphs for completion/hover/defs, and the invariants for keeping it fast and crash-proof. The lsp module (located in src/atopile/lsp/) implements the Language Server Protocol for atopile. It provides IDE features like autocomplete, go-to-definition, and diagnostics (error reporting)…”.
- **02** When the source has headings, the agent prioritizes “Quick Start / Relevant Files / Dependants (Call Sites)” so the result follows the author’s structure.
- **03** Typical output includes task judgment, concrete steps, required commands or file edits, validation, and follow-up options.
- **04** Risk context follows the fingerprint: read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
## Running Rules
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding scope.
- Return the result, validation criteria, and next iteration options. The source does not require a stable slash command. After installation, invoke the skill by name and describe the task.
Name target files or source material, expected output, forbidden changes, and whether network or shell access is allowed. Permission fingerprint: read files, write/modify files, run shell commands.
Start with a small task and check whether the result follows “Quick Start / Relevant Files / Dependants (Call Sites)”. Inspect diffs, logs, previews, or tests before expanding scope.
Confirm the final output includes a concrete result, evidence, and next action. If it stays generic, tighten inputs, boundaries, and acceptance criteria.
---
name: lsp
description: How the atopile Language Server works (pygls), how it builds per-document graphs for completion/…
category: other
source: atopile/atopile
---
# lsp
## When to use
- How the atopile Language Server works (pygls), how it builds per-document graphs for completion/hover/defs, and the in…
- Use it when the task has clear inputs, repeatable steps, and validation criteria.
## What to provide
- Target material, scope, expected result, and forbidden changes.
- Whether network, commands, file writes, or external services are allowed.
## Execution rules
- Organize steps around “Quick Start / Relevant Files / Dependants (Call Sites)” and keep inference separate from source facts.
- read files, write/modify files, run shell commands; mostly runs locally; usually needs no extra API key.
- Validate with a small sample before expanding the task.
## Output requirements
- Return the deliverable, key evidence, validation method, and next action.
- Mark missing information as unknown; do not invent commands, platforms, or dependencies. The author source anchors workflow facts; repository files anchor sources and commands; Fluxly only adds fit, limitations, and quality judgment.
skill "lsp" {
input -> user goal + target files + boundaries + acceptance criteria
context -> Quick Start / Relevant Files / Dependants (Call Sites)
rules -> SKILL.md triggers / order / output contract
runtime -> Python | read files, write/modify files, run shell commands | mostly runs locally
guardrails -> usually needs no extra API key + small-sample validation + diff/log review
output -> copyable result + checklist + next iteration
} LSP Module
The lsp module (located in src/atopile/lsp/) implements the Language Server Protocol for atopile. It provides IDE features like autocomplete, go-to-definition, and diagnostics (error reporting) for ato files.
Quick Start
Run the server on stdio (what editors expect):
python -m atopile.lsp.lsp_server
Relevant Files
- Server implementation:
src/atopile/lsp/lsp_server.py- owns global
LSP_SERVER(pyglsLanguageServer) - maintains per-document
DocumentState(graph/typegraph/build_result) - implements completion/hover/definition/diagnostics handlers
- owns global
- Utilities:
src/atopile/lsp/lsp_utils.py - Optional debugging helper:
src/atopile/lsp/_debug_server.py
Dependants (Call Sites)
- VSCode Extension: The designated client for this server.
- Compiler: The LSP invokes the compiler (often in a partial or fault-tolerant mode) to understand the code structure.
How to Work With / Develop / Test
Core Concepts
- Partial Compilation: Unlike the CLI build, the LSP must handle broken or incomplete code without crashing.
- Latency: Features must be fast (<50ms for typing, <200ms for completion).
- Per-document graphs: each open document has an isolated
GraphView+TypeGraphstored inDocumentState. - Keep last good build: the server keeps the last successful
BuildFileResultto power completion/hover even when the current edit has errors.
Development Workflow
- Edit handlers/helpers in
src/atopile/lsp/lsp_server.py. - Run completion tests (fast loop) and verify GraphView cleanup paths.
Testing
- Integration-style tests:
ato dev test --llm test/test_lsp_completion.py -q
Best Practices
- Robustness: Never let the server crash. Catch all exceptions in handlers and log them.
- Debouncing: Don't trigger expensive operations on every keystroke.
Core Invariants (easy to regress)
- Always destroy old graphs on rebuild/reset (
DocumentState.reset_graphcallsGraphView.destroy()). - Do not assume builds succeed; most features must handle:
- syntax errors (ANTLR)
- partial typegraphs
- exceptions from linking/deferred execution
Decide Fit First
Design Intent
How To Use It
Boundaries And Review