openlawlibrary / pygls

A pythonic generic language server
https://pygls.readthedocs.io/en/latest/
Apache License 2.0
575 stars 103 forks source link

test: add end-to-end tests for the various formatting requests #448

Closed alcarney closed 5 months ago

alcarney commented 5 months ago

Description (e.g. "Related to ...", etc.)

Following on from #440 this adds an example formatting.py server that implements the following requests

The server is intended to help with formatting simple markdown like tables

Screencast_20240425_182444.webm

As the above clip shows the on-type formatting is a little clunky to use (and buggy in some scenarios) but it should be enough to serve as a demo on how to get started. Also the relevant tests in tests/lsp have been migrated to end-to-end tests using the new example server.

Code review checklist (for code reviewer to complete)

tombh commented 5 months ago

Wow, I'd never thought of using formatting for those kind of little things. LSP's uses are endless.