Skip to content
This repository was archived by the owner on Apr 14, 2022. It is now read-only.

Conversation

@MikhailArkhipov
Copy link

Fixes #1543
Sligtly different from #1585.

Found another case of buffer corruption. Happens when module reload comes during analysis.
Repro:

  • Remove black formatter if you have one installed.
  • Open scikit-learn
  • Open conftest.py
  • While analysis is running, make changes like add space after dot in del sys._is_pytest_session
  • Format document
  • When prompted to install black say yes.
  • When formatter is installed and analysis still running, format document.
  • The buffer is now corrupted since changes comes over content reloaded by ReloadAll.

Separated Reset into SetContent, MarkChanged and Clear.
Added exceptions to make sure Populate only happens once and there is no Update after Clear.
MarkChanged advances version so analysis thinks buffer has changed without actually reloading it.

@MikhailArkhipov MikhailArkhipov merged commit 2ad7dd4 into microsoft:master Sep 26, 2019
@MikhailArkhipov MikhailArkhipov deleted the b1558-1 branch September 26, 2019 23:42
jakebailey pushed a commit to jakebailey/python-language-server that referenced this pull request Nov 1, 2019
* Separate reset into init/clear/touch

* Fix module creation analysis

* Fix find references
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Strange parsing errors

2 participants