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:
Joseph T. Lyons 2025-05-26 23:04:31 -04:00 committed by GitHub
parent 4a577fff4a
commit c208532693
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
79 changed files with 319 additions and 306 deletions

View file

@ -2193,7 +2193,7 @@ impl EditorElement {
) {
let mouse_position = window.mouse_position();
let mouse_over_inline_blame = parent_bounds.contains(&mouse_position);
let mouse_over_popover = self.editor.update(cx, |editor, _| {
let mouse_over_popover = self.editor.read_with(cx, |editor, _| {
editor
.inline_blame_popover
.as_ref()
@ -2209,7 +2209,7 @@ impl EditorElement {
}
});
let should_draw = self.editor.update(cx, |editor, _| {
let should_draw = self.editor.read_with(cx, |editor, _| {
editor
.inline_blame_popover
.as_ref()
@ -2243,7 +2243,7 @@ impl EditorElement {
if let Some(mut element) = maybe_element {
let size = element.layout_as_root(AvailableSpace::min_size(), window, cx);
let origin = self.editor.update(cx, |editor, _| {
let origin = self.editor.read_with(cx, |editor, _| {
let target_point = editor
.inline_blame_popover
.as_ref()
@ -4322,7 +4322,7 @@ impl EditorElement {
..Default::default()
};
window.with_text_style(Some(text_style), |window| {
let mut element = self.editor.update(cx, |editor, _| {
let mut element = self.editor.read_with(cx, |editor, _| {
let mouse_context_menu = editor.mouse_context_menu.as_ref()?;
let context_menu = mouse_context_menu.context_menu.clone();