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

Add example server for textDocument/rename and textDocument/prepareRename #452

Merged
merged 3 commits into from
May 3, 2024

Conversation

alcarney
Copy link
Collaborator

@alcarney alcarney commented May 3, 2024

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

Continuing the trend of adding example servers and end-to-end tests, this PR tackles the textDocument/rename and textDocument/prepareRename requests.

The implementation is no smarter than a naive search and replace (ideally the server should take into account language semantics), but it's enough to demonstrate the expected interaction with the client.

Screenshot_20240503_193708

This also includes a fix to ensure the ServerCapabilitiesBuilder correctly computes capabilities when defining a textDocument/prepareRename handler

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

Copy link
Collaborator

@tombh tombh left a comment

Choose a reason for hiding this comment

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

Great. My only minor comment is one from before, I think it'd be nice to have a brief description at the top of examples/servers/rename.py describing the experience of the server from the perspective of an end user. But it's minor, so approving ✅

@alcarney
Copy link
Collaborator Author

alcarney commented May 3, 2024

I think it'd be nice to have a brief description at the top of examples/servers/rename.py

Good point, the end user perspective could be a little tricky as it will vary between clients, though I suppose we could just say "in VSCode this does X". I'll try to do a proper documentation pass on these at some point - there's plenty that can be expanded upon (user experience, client capabilities etc.), I'm focusing on the test suite side of things atm as it's the main thing blocking me making progress on #418

That said, I'll make sure to include a description with the next one! :)

But it's minor, so approving ✅

Thanks!

@alcarney alcarney merged commit d1a8dd7 into openlawlibrary:main May 3, 2024
16 checks passed
@alcarney alcarney deleted the example branch May 3, 2024 19:51
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.

None yet

2 participants