Skip to content

feat(ServerTextPosition): implement comparison operators#597

Merged
tombh merged 2 commits intoopenlawlibrary:mainfrom
lheckemann:push-trnyrroyzvus
Mar 25, 2026
Merged

feat(ServerTextPosition): implement comparison operators#597
tombh merged 2 commits intoopenlawlibrary:mainfrom
lheckemann:push-trnyrroyzvus

Conversation

@lheckemann
Copy link
Copy Markdown
Contributor

@lheckemann lheckemann commented Mar 13, 2026

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

lsprotocol's Position type implements comparison operators, which can be quite convenient when implementing a language server. Mirror this functionality in ServerTextPosition.

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

Automated linters

You can run the lints that are run on CI locally with:

uv run --all-extras poe lint

@lheckemann
Copy link
Copy Markdown
Contributor Author

I've opened a PR to implement similar overlap and inclusion functions in lsprotocol itself as well: microsoft/lsprotocol#448

@lheckemann lheckemann marked this pull request as ready for review March 24, 2026 16:00
@lheckemann
Copy link
Copy Markdown
Contributor Author

Hi @tombh , looks like this fell through the cracks and didn't make it into the latest release (maybe because it was a draft? do let me know if that was it or if there's something else I should have done to get attention on this ^^); I think it would be good to get at least the first commit into a patch release, as the comparison operators that worked on the Position objects formerly returned currently don't work with the new ServerTextPositions.

@tombh tombh self-requested a review March 25, 2026 11:02
@tombh tombh force-pushed the push-trnyrroyzvus branch from b3b960c to 77155f4 Compare March 25, 2026 11:03
@tombh
Copy link
Copy Markdown
Collaborator

tombh commented Mar 25, 2026

Ah sorry, yes I saw the DRAFT status and thought you were still working on it. No worries we can just do a point release.

@tombh tombh merged commit dc349ea into openlawlibrary:main Mar 25, 2026
18 checks passed
@lheckemann
Copy link
Copy Markdown
Contributor Author

Awesome, thanks!

@lheckemann lheckemann deleted the push-trnyrroyzvus branch March 25, 2026 12:52
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