Release syntax aware heuristic expansion of diagnostic excerpts (#22858)
Implementation PR was #21942 Release Notes: - Improved diagnostic excerpts by using syntactic info to determine the context lines to show.
This commit is contained in:
parent
9ef454d7eb
commit
fe35695b13
3 changed files with 10 additions and 15 deletions
1
Cargo.lock
generated
1
Cargo.lock
generated
|
@ -3690,7 +3690,6 @@ dependencies = [
|
||||||
"ctor",
|
"ctor",
|
||||||
"editor",
|
"editor",
|
||||||
"env_logger 0.11.6",
|
"env_logger 0.11.6",
|
||||||
"feature_flags",
|
|
||||||
"gpui",
|
"gpui",
|
||||||
"language",
|
"language",
|
||||||
"log",
|
"log",
|
||||||
|
|
|
@ -18,7 +18,6 @@ collections.workspace = true
|
||||||
ctor.workspace = true
|
ctor.workspace = true
|
||||||
editor.workspace = true
|
editor.workspace = true
|
||||||
env_logger.workspace = true
|
env_logger.workspace = true
|
||||||
feature_flags.workspace = true
|
|
||||||
gpui.workspace = true
|
gpui.workspace = true
|
||||||
language.workspace = true
|
language.workspace = true
|
||||||
log.workspace = true
|
log.workspace = true
|
||||||
|
|
|
@ -14,7 +14,6 @@ use editor::{
|
||||||
scroll::Autoscroll,
|
scroll::Autoscroll,
|
||||||
Editor, EditorEvent, ExcerptId, ExcerptRange, MultiBuffer, ToOffset,
|
Editor, EditorEvent, ExcerptId, ExcerptRange, MultiBuffer, ToOffset,
|
||||||
};
|
};
|
||||||
use feature_flags::FeatureFlagAppExt;
|
|
||||||
use gpui::{
|
use gpui::{
|
||||||
actions, div, svg, AnyElement, AnyView, AppContext, Context, EventEmitter, FocusHandle,
|
actions, div, svg, AnyElement, AnyView, AppContext, Context, EventEmitter, FocusHandle,
|
||||||
FocusableView, Global, HighlightStyle, InteractiveElement, IntoElement, Model, ParentElement,
|
FocusableView, Global, HighlightStyle, InteractiveElement, IntoElement, Model, ParentElement,
|
||||||
|
@ -933,7 +932,6 @@ fn context_range_for_entry(
|
||||||
snapshot: &BufferSnapshot,
|
snapshot: &BufferSnapshot,
|
||||||
cx: &AppContext,
|
cx: &AppContext,
|
||||||
) -> Range<Point> {
|
) -> Range<Point> {
|
||||||
if cx.is_staff() {
|
|
||||||
if let Some(rows) = heuristic_syntactic_expand(
|
if let Some(rows) = heuristic_syntactic_expand(
|
||||||
entry.range.clone(),
|
entry.range.clone(),
|
||||||
DIAGNOSTIC_EXPANSION_ROW_LIMIT,
|
DIAGNOSTIC_EXPANSION_ROW_LIMIT,
|
||||||
|
@ -945,7 +943,6 @@ fn context_range_for_entry(
|
||||||
end: snapshot.clip_point(Point::new(*rows.end(), u32::MAX), Bias::Left),
|
end: snapshot.clip_point(Point::new(*rows.end(), u32::MAX), Bias::Left),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
|
||||||
Range {
|
Range {
|
||||||
start: Point::new(entry.range.start.row.saturating_sub(context), 0),
|
start: Point::new(entry.range.start.row.saturating_sub(context), 0),
|
||||||
end: snapshot.clip_point(
|
end: snapshot.clip_point(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue