This document describes how to verify and update the feature support matrix in the README.
uv run pytest tests/test_session.py -vTests are parametrized across all backends (Pyright, Pyrefly, ty). Key indicators:
- PASSED: Feature works for that backend
- XFAIL: Known limitation, documented with reason
- FAILED: Regression or new issue
In tests/test_session.py, search for xfail to find documented limitations:
# Example from test_session_diagnostics:
if backend_name == "ty":
pytest.xfail("ty requires files on disk for diagnostics")Each xfail message explains why the feature is limited.
Each backend declares its LSP capabilities in get_lsp_capabilities():
lsp_types/pyright/backend.pylsp_types/pyrefly/backend.pylsp_types/ty/backend.py
Features declared here indicate what the client advertises to the server.
- After adding new Session API methods: Add test, run it, update table
- After upgrading backend versions: Re-run tests, check for improvements, update version line
- After backend releases announce new features: Test and document
Update the "Last verified" line in README when re-testing:
# Check installed versions
pyright --version # or basedpyright --version
pyrefly --version
ty --version| Symbol | Meaning | When to Use |
|---|---|---|
| ✅ | Fully supported | Test passes without xfail |
| Partial support | Test has xfail or conditional skip | |
| ❌ | Not supported | Feature fails or is documented as unsupported |
| ❔ | Unknown | Not exposed in Session API or not tested |
- Keep notes concise (under 50 characters)
- Reference the specific limitation (e.g., "requires files on disk")
- Use semicolons to separate multiple backend notes
| Feature | Test Function | Lines to Check |
|---|---|---|
| Diagnostics | test_session_diagnostics |
xfail around line 72 |
| Hover | test_session_hover |
format check around line 142 |
| Completion | test_session_completion |
xfail around line 258 |
| Completion Resolution | test_session_completion |
skip condition around line 286 |
| Signature Help | test_session_signature_help |
No xfails expected |
| Rename | test_session_rename |
xfails around lines 154, 158 |
| Semantic Tokens | test_session_semantic_tokens |
No xfails expected |
Features declared in backend capabilities but not exposed in Session API:
- Go to Definition (Pyrefly, ty declare it)
- Find References (Pyrefly, ty declare it)
- Code Actions
- Formatting
To test these, use the low-level LSPProcess API directly.