Skip to content

Commit

Permalink
Re-instate actually updating the server on file ready to parse
Browse files Browse the repository at this point in the history
Perversely, in LSP completer, OnFileReadyToParse never parsed anything.
At least, not in the obvious way.

The original bug where we were doing redundant updates, ironically, was
ensuring that we (eventually) updated the server with file contents (at
some point in time) when we get OnFileReadyToParse.

But by fixing that, we now never actually used the data supplied in
OnFileReadyToParse, which the tests were relying heavily on. In
particular, the Java tests would update file contents using only
OnFileReadyToParse, which is a completely legitimate thing to do in our
API. And worked. Until it didn't.

Now it does again - we explicitly update server file state in
OnFileReadyToParse, which seems perfectly sensible.
  • Loading branch information
puremourning committed Dec 22, 2023
1 parent 5a01b73 commit 6778d57
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions ycmd/completers/language_server/language_server_completer.py
Original file line number Diff line number Diff line change
Expand Up @@ -1922,6 +1922,8 @@ def ClearOneshotHandlers():
handler( self, request_data )
ClearOneshotHandlers()

self._UpdateServerWithFileContents( request_data )

# Return the latest diagnostics that we have received.
#
# NOTE: We also return diagnostics asynchronously via the long-polling
Expand Down

0 comments on commit 6778d57

Please sign in to comment.