Skip to content

Latest commit

Β 

History

History
80 lines (58 loc) Β· 2.03 KB

File metadata and controls

80 lines (58 loc) Β· 2.03 KB

Contributing to sage-lsp

Thanks for your interest in improving sage-lsp.

Development setup

Tip

Install in a sage-enabled environment

git clone https://github.com/SeanDictionary/sage-lsp.git && cd sage-lsp
pip install -e .

Run tests

Warning

All tests will successfully run without any Error. They are only used to simulate a simple LSP client and check the results.

pytest test/

Useful commands: exp.

pytest tests/test_completion.py
pytest tests/test_hover.py -k basic
pytest -s -v --tb=short

For more LSP test details, see tests/README.md.

Project structure

.
β”œβ”€β”€ CHANGELOG.md
β”œβ”€β”€ CONTRIBUTING.md
β”œβ”€β”€ LICENSE
β”œβ”€β”€ README.md
β”œβ”€β”€ pyproject.toml
β”œβ”€β”€ src
β”‚   └── sagelsp
β”‚       β”œβ”€β”€ config                  style/config helpers
β”‚       β”œβ”€β”€ plugins                 plugin implementations (lint, format, hover, completion, etc.)
β”‚       β”œβ”€β”€ __init__.py
β”‚       β”œβ”€β”€ __main__.py
β”‚       β”œβ”€β”€ _version.py
β”‚       β”œβ”€β”€ server.py               LSP feature registration and request handlers
β”‚       └── symbols_cache.py        local cache for Sage symbols and import paths
└── tests                           end-to-end style LSP tests and utilities

Pull request guidelines

Please keep PRs focused and small when possible.

Before opening a PR:

  1. Ensure tests pass locally.
  2. Update docs if behavior changed (README.md, this file, or test docs).
  3. Add an entry under Unreleased in CHANGELOG.md.
  4. Include a short summary of what changed and why.

Coding notes

  • Keep plugin behavior resilient: failed plugin hooks should not crash the whole server.
  • Prefer minimal, targeted changes over broad refactors.
  • When changing LSP behavior, add or update tests in tests/.

Reporting issues

When filing an issue, include:

  • SageMath version (sagelsp --sage output if possible)
  • Python version
  • Editor and LSP client configuration
  • Minimal reproducible code sample