Use read-only access methods for read-only entity operations (#31479)
Another follow-up to #31254 Release Notes: - N/A
This commit is contained in:
parent
4a577fff4a
commit
c208532693
79 changed files with 319 additions and 306 deletions
|
@ -14610,7 +14610,7 @@ impl Editor {
|
|||
let location = match location_task {
|
||||
Some(task) => Some({
|
||||
let target_buffer_handle = task.await.context("open local buffer")?;
|
||||
let range = target_buffer_handle.update(cx, |target_buffer, _| {
|
||||
let range = target_buffer_handle.read_with(cx, |target_buffer, _| {
|
||||
let target_start = target_buffer
|
||||
.clip_point_utf16(point_from_lsp(lsp_location.range.start), Bias::Left);
|
||||
let target_end = target_buffer
|
||||
|
@ -14799,7 +14799,7 @@ impl Editor {
|
|||
} else {
|
||||
if PreviewTabsSettings::get_global(cx).enable_preview_from_code_navigation {
|
||||
let (preview_item_id, preview_item_idx) =
|
||||
workspace.active_pane().update(cx, |pane, _| {
|
||||
workspace.active_pane().read_with(cx, |pane, _| {
|
||||
(pane.preview_item_id(), pane.preview_item_idx())
|
||||
});
|
||||
|
||||
|
@ -20115,7 +20115,7 @@ impl SemanticsProvider for Entity<Project> {
|
|||
PrepareRenameResponse::InvalidPosition => None,
|
||||
PrepareRenameResponse::OnlyUnpreparedRenameSupported => {
|
||||
// Fallback on using TreeSitter info to determine identifier range
|
||||
buffer.update(cx, |buffer, _| {
|
||||
buffer.read_with(cx, |buffer, _| {
|
||||
let snapshot = buffer.snapshot();
|
||||
let (range, kind) = snapshot.surrounding_word(position);
|
||||
if kind != Some(CharKind::Word) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue