Follow-up semantic token fixes (#48485)

Follow-up of https://github.com/zed-industries/zed/pull/46356

* better selection in highlights panel to show the color of the active
item
* no `DiffbaselessAnchor` entity to cause flickering and highlighting
issues
* react on theme and theme settings change and refresh semantic tokens
* do not eagerly flicker when refreshing the tokens
* do not show semantic tokens in the editor menu for non-applicable
buffers

Release Notes:

- N/A
This commit is contained in:
Kirill Bulatov authored and GitHub committed 2026-02-05 15:06:02 +00:00
1 parent e63eb54201
commit 3e8fbfccdc
12 files changed
+550 -405

No files matched your search

+1 -20
View File
@@ -6,9 +6,7 @@ mod transaction;
use self::transaction::History;
pub use anchor::{
Anchor, AnchorHasDiffbaseError, AnchorRangeExt, DiffbaselessAnchor, DiffbaselessAnchorRangeExt,
};
pub use anchor::{Anchor, AnchorRangeExt};
use anyhow::{Result, anyhow};
use buffer_diff::{
@@ -7312,23 +7310,6 @@ impl Excerpt {
.is_ge()
}
fn contains_diffbaseless(&self, anchor: &DiffbaselessAnchor) -> bool {
(anchor.text_anchor.buffer_id == None
|| anchor.text_anchor.buffer_id == Some(self.buffer_id))
&& self
.range
.context
.start
.cmp(&anchor.text_anchor, &self.buffer)
.is_le()
&& self
.range
.context
.end
.cmp(&anchor.text_anchor, &self.buffer)
.is_ge()
}
/// The [`Excerpt`]'s start offset in its [`Buffer`]
fn buffer_start_offset(&self) -> BufferOffset {
BufferOffset(self.range.context.start.to_offset(&self.buffer))