diff --git a/helix-term/src/commands/lsp.rs b/helix-term/src/commands/lsp.rs index 38507e4dd1cb..61eed63874eb 100644 --- a/helix-term/src/commands/lsp.rs +++ b/helix-term/src/commands/lsp.rs @@ -863,10 +863,7 @@ pub fn signature_help_impl(cx: &mut Context, invoked: SignatureHelpInvoked) { } }; let doc = doc!(editor); - let language = doc - .language() - .and_then(|scope| scope.strip_prefix("source.")) - .unwrap_or(""); + let language = doc.language_name().unwrap_or(""); let signature = match response .signatures diff --git a/helix-term/src/ui/completion.rs b/helix-term/src/ui/completion.rs index c1816db1fda8..a96a9dc30d95 100644 --- a/helix-term/src/ui/completion.rs +++ b/helix-term/src/ui/completion.rs @@ -321,10 +321,7 @@ impl Component for Completion { // option.documentation let (view, doc) = current!(cx.editor); - let language = doc - .language() - .and_then(|scope| scope.strip_prefix("source.")) - .unwrap_or(""); + let language = doc.language_name().unwrap_or(""); let text = doc.text().slice(..); let cursor_pos = doc.selection(view.id).primary().cursor(text); let coords = helix_core::visual_coords_at_pos(text, cursor_pos, doc.tab_width()); diff --git a/helix-term/src/ui/statusline.rs b/helix-term/src/ui/statusline.rs index 75e5dbd7bb43..b2836f508850 100644 --- a/helix-term/src/ui/statusline.rs +++ b/helix-term/src/ui/statusline.rs @@ -329,7 +329,7 @@ fn render_file_type(context: &mut RenderContext, write: F) where F: Fn(&mut RenderContext, String, Option