Refactor to use SharedString in more places (#23813)

Splitting this off from
https://github.com/zed-industries/zed/pull/23808, per @maxdeviant's
suggestion!

Release Notes:

- N/A

---------

Co-authored-by: Nathan <nathan@zed.dev>
This commit is contained in:
Richard Feldman 2025-01-28 19:04:21 -05:00 committed by GitHub
parent 92a1cb893f
commit 33d1145c3f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
15 changed files with 45 additions and 25 deletions

View file

@ -10,7 +10,7 @@ use std::{
use anyhow::{Context as _, Result};
use collections::{HashMap, HashSet, VecDeque};
use gpui::{App, AppContext as _, Entity, Task};
use gpui::{App, AppContext as _, Entity, SharedString, Task};
use itertools::Itertools;
use language::{ContextProvider, File, Language, LanguageToolchainStore, Location};
use settings::{parse_json_with_comments, SettingsLocation};
@ -53,7 +53,7 @@ pub enum TaskSourceKind {
abs_path: PathBuf,
},
/// Languages-specific tasks coming from extensions.
Language { name: Arc<str> },
Language { name: SharedString },
}
impl TaskSourceKind {
@ -91,7 +91,7 @@ impl Inventory {
cx: &App,
) -> Vec<(TaskSourceKind, TaskTemplate)> {
let task_source_kind = language.as_ref().map(|language| TaskSourceKind::Language {
name: language.name().0,
name: language.name().into(),
});
let global_tasks = self.global_templates_from_settings();
let language_tasks = language
@ -124,7 +124,7 @@ impl Inventory {
.as_ref()
.and_then(|location| location.buffer.read(cx).language_at(location.range.start));
let task_source_kind = language.as_ref().map(|language| TaskSourceKind::Language {
name: language.name().0,
name: language.name().into(),
});
let file = location
.as_ref()