Release Notes: - N/A *or* Added/Fixed/Improved ... Co-authored by: Kate <kate@zed.dev>
Showing the changes to crates/languages/src/python.rs (1 of 67 files). Show all
Unified · Split
| @@ -19,6 +19,7 @@ use pet_core::python_environment::{PythonEnvironment, PythonEnvironmentKind}; · 18 unmodified lines | ||
| 19 | 19 | use pet_virtualenv::is_virtualenv_dir; |
| 20 | 20 | use project::Fs; |
| 21 | 21 | use project::lsp_store::language_server_settings; |
| 22 | +use rope::Rope; | |
| 22 | 23 | use serde::{Deserialize, Serialize}; |
| 23 | 24 | use serde_json::{Value, json}; |
| 24 | 25 | use smol::lock::OnceCell; |
| @@ -466,7 +467,7 @@ impl LspAdapter for PyrightLspAdapter { · 441 unmodified lines | ||
| 466 | 467 | Some(language::CodeLabel::new( |
| 467 | 468 | text[display_range.clone()].to_string(), |
| 468 | 469 | filter_range, |
| 469 | − language.highlight_text(&text.as_str().into(), display_range), | |
| 470 | + language.highlight_text(&Rope::from_str_small(text.as_str()), display_range), | |
| 470 | 471 | )) |
| 471 | 472 | } |
| 472 | 473 | |
| @@ -1511,7 +1512,7 @@ impl LspAdapter for PyLspAdapter { · 1038 unmodified lines | ||
| 1511 | 1512 | Some(language::CodeLabel::new( |
| 1512 | 1513 | text[display_range.clone()].to_string(), |
| 1513 | 1514 | filter_range, |
| 1514 | − language.highlight_text(&text.as_str().into(), display_range), | |
| 1515 | + language.highlight_text(&Rope::from_str_small(text.as_str()), display_range), | |
| 1515 | 1516 | )) |
| 1516 | 1517 | } |
| 1517 | 1518 | |
| @@ -1800,7 +1801,7 @@ impl LspAdapter for BasedPyrightLspAdapter { · 282 unmodified lines | ||
| 1800 | 1801 | Some(language::CodeLabel::new( |
| 1801 | 1802 | text[display_range.clone()].to_string(), |
| 1802 | 1803 | filter_range, |
| 1803 | − language.highlight_text(&text.as_str().into(), display_range), | |
| 1804 | + language.highlight_text(&Rope::from_str_small(text.as_str()), display_range), | |
| 1804 | 1805 | )) |
| 1805 | 1806 | } |
| 1806 | 1807 | |