Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Apr 26, 2024

Conversation

alcarney
Copy link
Collaborator

@alcarney alcarney commented Apr 25, 2024

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

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

  • textDocument/formatting
  • textDocument/rangeFormatting
  • textDocument/onTypeFormatting

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)

  • Pull request represents a single change (i.e. not fixing disparate/unrelated things in a single PR)
  • Title summarizes what is changing
  • Commit messages are meaningful (see this for details)
  • Tests have been included and/or updated, as appropriate
  • Docstrings have been included and/or updated, as appropriate
  • Standalone docs have been updated accordingly

@alcarney alcarney requested a review from tombh April 25, 2024 17:32
@alcarney alcarney force-pushed the formatting-examples branch from f20061e to b521d05 Compare April 25, 2024 17:33
@alcarney alcarney force-pushed the formatting-examples branch from b521d05 to 18548c9 Compare April 25, 2024 17:43
@@ -0,0 +1,3 @@
|a|b|
|-|-|
|apple|banana|
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🍎🍌

@tombh
Copy link
Collaborator

tombh commented Apr 25, 2024

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

@alcarney alcarney merged commit 5831c1f into openlawlibrary:main Apr 26, 2024
16 checks passed
@alcarney alcarney deleted the formatting-examples branch April 26, 2024 17:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants