-
Notifications
You must be signed in to change notification settings - Fork 134
Synchronize text buffer access #1479
Conversation
| public string Text { | ||
| get { | ||
| lock (_lock) { | ||
| return _content ?? (_content = _sb?.ToString() ?? string.Empty); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the case when _content == null and _sb == null?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically when something calls Text before initial Update
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
However, we can just create _sb at construction time for simplicity
|
I am using the latest version of the extension (2019.9.34911) and the synchronization problem still exists. |
|
LS version is unrelated to the extension version and is not tied to it. Which LS version do you see in the output? Something like 0.3.x or 0.4.x |
|
Please open an issue with your problem and the information we request in the template; if this PR didn't fix your issue, then it may be something else. Note that the extension version is not the language server version. They are versioned separately. |
* Synchronize text buffer * Simplify * One more * Use ?? * Typo * Simplify
Fixes #1466
Fixes #1449
Fixes #1425
Fixes #1353
Although text buffer updates come from the same thread, it does can be read concurrently by the analysis and Reset can be called as well (although this is probably extremely rare as we do not call Reset on user files when analysis completes).
Call for content by the parser or analyzer may cause conversion of the string builder to
_contentin the middle of the string builder update yielding odd partial results.