Closes https://github.com/zed-industries/zed/issues/34310 Follow-up of https://github.com/zed-industries/zed/pull/29359 Release Notes: - Fixed goto definition not working in remote projects in certain conditions
Unified · Split
| @@ -3364,8 +3364,14 @@ impl Project { · 3363 unmodified lines | ||
| 3364 | 3364 | cx: &mut Context<Self>, |
| 3365 | 3365 | ) -> Task<Result<Vec<LocationLink>>> { |
| 3366 | 3366 | let position = position.to_point_utf16(buffer.read(cx)); |
| 3367 | − self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3367 | + let guard = self.retain_remotely_created_models(cx); | |
| 3368 | + let task = self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3368 | 3369 | lsp_store.definitions(buffer, position, cx) |
| 3370 | + }); | |
| 3371 | + cx.spawn(async move |_, _| { | |
| 3372 | + let result = task.await; | |
| 3373 | + drop(guard); | |
| 3374 | + result | |
| 3369 | 3375 | }) |
| 3370 | 3376 | } |
| 3371 | 3377 | |
| @@ -3376,8 +3382,14 @@ impl Project { · 4 unmodified lines | ||
| 3376 | 3382 | cx: &mut Context<Self>, |
| 3377 | 3383 | ) -> Task<Result<Vec<LocationLink>>> { |
| 3378 | 3384 | let position = position.to_point_utf16(buffer.read(cx)); |
| 3379 | − self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3385 | + let guard = self.retain_remotely_created_models(cx); | |
| 3386 | + let task = self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3380 | 3387 | lsp_store.declarations(buffer, position, cx) |
| 3388 | + }); | |
| 3389 | + cx.spawn(async move |_, _| { | |
| 3390 | + let result = task.await; | |
| 3391 | + drop(guard); | |
| 3392 | + result | |
| 3381 | 3393 | }) |
| 3382 | 3394 | } |
| 3383 | 3395 | |
| @@ -3388,8 +3400,14 @@ impl Project { · 4 unmodified lines | ||
| 3388 | 3400 | cx: &mut Context<Self>, |
| 3389 | 3401 | ) -> Task<Result<Vec<LocationLink>>> { |
| 3390 | 3402 | let position = position.to_point_utf16(buffer.read(cx)); |
| 3391 | − self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3403 | + let guard = self.retain_remotely_created_models(cx); | |
| 3404 | + let task = self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3392 | 3405 | lsp_store.type_definitions(buffer, position, cx) |
| 3406 | + }); | |
| 3407 | + cx.spawn(async move |_, _| { | |
| 3408 | + let result = task.await; | |
| 3409 | + drop(guard); | |
| 3410 | + result | |
| 3393 | 3411 | }) |
| 3394 | 3412 | } |
| 3395 | 3413 | |
| @@ -3400,8 +3418,14 @@ impl Project { · 4 unmodified lines | ||
| 3400 | 3418 | cx: &mut Context<Self>, |
| 3401 | 3419 | ) -> Task<Result<Vec<LocationLink>>> { |
| 3402 | 3420 | let position = position.to_point_utf16(buffer.read(cx)); |
| 3403 | − self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3421 | + let guard = self.retain_remotely_created_models(cx); | |
| 3422 | + let task = self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3404 | 3423 | lsp_store.implementations(buffer, position, cx) |
| 3424 | + }); | |
| 3425 | + cx.spawn(async move |_, _| { | |
| 3426 | + let result = task.await; | |
| 3427 | + drop(guard); | |
| 3428 | + result | |
| 3405 | 3429 | }) |
| 3406 | 3430 | } |
| 3407 | 3431 | |
| @@ -3412,8 +3436,14 @@ impl Project { · 4 unmodified lines | ||
| 3412 | 3436 | cx: &mut Context<Self>, |
| 3413 | 3437 | ) -> Task<Result<Vec<Location>>> { |
| 3414 | 3438 | let position = position.to_point_utf16(buffer.read(cx)); |
| 3415 | − self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3439 | + let guard = self.retain_remotely_created_models(cx); | |
| 3440 | + let task = self.lsp_store.update(cx, |lsp_store, cx| { | |
| 3416 | 3441 | lsp_store.references(buffer, position, cx) |
| 3442 | + }); | |
| 3443 | + cx.spawn(async move |_, _| { | |
| 3444 | + let result = task.await; | |
| 3445 | + drop(guard); | |
| 3446 | + result | |
| 3417 | 3447 | }) |
| 3418 | 3448 | } |
| 3419 | 3449 | |