Skip to content

Mark deprecated rangeLength optional in TextDocumentContentChangeEvent - #123

Merged
danixeee merged 3 commits into
openlawlibrary:masterfrom
deathaxe:pr/remove-didchange-rangelength
Jun 18, 2020
Merged

danixeee merged 3 commits into
openlawlibrary:masterfrom
deathaxe:pr/remove-didchange-rangelength

Conversation

@deathaxe

Copy link
Copy Markdown

The rangeLength attribute in the TextDocumentContentChangeEvent is marked deprecated and therefore no longer enforced by pygls. If it is passed by a client, it is accepted silently, but as it is not needed for text synchronization at all, it is marked optional.

As the result the whole Document.apply_change() method can be slightly simplified.

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

Please replace this description with a concise description of this Pull Request.

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
  • CONTRIBUTORS.md was updated, as appropriate
  • Changelog has been updated, as needed (see CHANGELOG.md)

Comment thread pygls/workspace.py
@danixeee danixeee added the enhancement New feature or request label May 14, 2020
@danixeee

Copy link
Copy Markdown
Contributor

mypy check still fails, can you check that? Maybe you can cherry-pick types.py changes from this PR to #125 and we can merge #125 first.

deathaxe added 3 commits May 18, 2020 18:15
The rangeLength attribute in the TextDocumentContentChangeEvent is
marked deprecated and therefore no longer enforced by pygls. If it is
passed by a client, it is accepted silently, but as it is not needed for
text synchronization at all, it is marked optional.

As the result the whole Document.apply_change() method can be slightly
simplified.
According to the LSP specs `range` is not optional but may be empty.
@danixeee

danixeee commented Jun 2, 2020

Copy link
Copy Markdown
Contributor

@pappasam Could you please check/confirm that this PR does not break fixes you made in #78?

@danixeee
danixeee merged commit 7bcd69d into openlawlibrary:master Jun 18, 2020
@deathaxe
deathaxe deleted the pr/remove-didchange-rangelength branch March 15, 2021 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants