Fix copilot state corruption when there are multiple buffers with the same remote id in different projects (#2569)
Fixes https://linear.app/zed-industries/issue/Z-1511/thread-main-panicked-at-assertion-failed-left-==-right-left-local-0-1 Previously, when exchanging messages about buffers with a copilot language server, we identified buffers using their **remote id**. This caused problems when there were multiple projects open, where one or more were remote, because buffers' remote ids are only unique within a given project. When you have multiple projects open, and one or more of the projects is remote, it's pretty easy to have two buffers open with the same remote id. In my testing, when this happened, copilot would stop working in both buffers. But I believe that depending on the editing patterns that occur in the two buffers, it could cause the crash reported in the Linear issue above. This PR changes our copilot logic to use buffers' local handle ids for identifying them. This fixed the problems I was able to reproduce when using copilot in both remote and local projects. Release Notes: - Fixed a crash that would sometimes occur when editing buffers after having collaborated on a remote project.
M
Max Brunsfeld committed
571151173c0abddb1767df9e8c57ddd1c2a23766
Committed by GitHub <noreply@github.com>
on 6/5/2023, 9:33:56 PM