edit_prediction_context: Minor optimization of text similarity + some renames (#38941)
Release Notes: - N/A
This commit is contained in:
@@ -18,7 +18,7 @@ use util::{ResultExt, paths::PathStyle, rel_path::RelPath};
|
||||
use workspace::{Item, SplitDirection, Workspace};
|
||||
use zeta2::{Zeta, ZetaOptions};
|
||||
|
||||
use edit_prediction_context::{EditPredictionExcerptOptions, SnippetStyle};
|
||||
use edit_prediction_context::{DeclarationStyle, EditPredictionExcerptOptions};
|
||||
|
||||
actions!(
|
||||
dev,
|
||||
@@ -285,7 +285,7 @@ impl Zeta2Inspector {
|
||||
let mut languages = HashMap::default();
|
||||
for lang_id in prediction
|
||||
.context
|
||||
.snippets
|
||||
.declarations
|
||||
.iter()
|
||||
.map(|snippet| snippet.declaration.identifier().language_id)
|
||||
.chain(prediction.context.excerpt_text.language_id)
|
||||
@@ -334,7 +334,7 @@ impl Zeta2Inspector {
|
||||
cx,
|
||||
);
|
||||
|
||||
for snippet in &prediction.context.snippets {
|
||||
for snippet in &prediction.context.declarations {
|
||||
let path = this
|
||||
.project
|
||||
.read(cx)
|
||||
@@ -345,7 +345,7 @@ impl Zeta2Inspector {
|
||||
"{} (Score density: {})",
|
||||
path.map(|p| p.path.display(path_style).to_string())
|
||||
.unwrap_or_else(|| "".to_string()),
|
||||
snippet.score_density(SnippetStyle::Declaration)
|
||||
snippet.score_density(DeclarationStyle::Declaration)
|
||||
))
|
||||
.unwrap()
|
||||
.into(),
|
||||
|
||||
Reference in New Issue
Block a user