-
Notifications
You must be signed in to change notification settings - Fork 172
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail requests that are searching for a non existing position (#2938)
### Motivation This is an attempt to handle and better understand #2446 We're seeing the server get stuck sometimes and I suspect that what's happening is the following: 1. A position request gets triggered, like completion, looking for a certain spot in the code 2. The code changes right as we start locating the position 3. Ruby switches threads and we process the text edit **before** finishing finding the specified position 4. Since now the document is in a different state, that position is no longer valid and it may lead to infinite loops I propose we start raising when we fail to locate a position in the document and then we fail the request. This will hopefully help us better understand what's happening. ### Implementation Started raising if the scanner position is already past the document range, which may happen if we modify the document exactly as we're searching for the position. ### Automated Tests Added tests.
- Loading branch information
Showing
4 changed files
with
76 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters