From 5b6201d2b2ecada020314ce8bc1f72607ac03e58 Mon Sep 17 00:00:00 2001
From: Finn Eitreim <48069764+feitreim@users.noreply.github.com>
Date: Tue, 17 Mar 2026 04:03:46 -0400
Subject: [PATCH] languages: Fix semantic tokens for Go (#51621)
Closes #51620
gopls requires more specific initialization for semantic tokens that
other language-servers for reasons that aren't entirely clear to me, it
is however a small fix to make it work. still trying to track down other
malfunctioning language servers in the semantic token realm, so if you
have suggestions let me know.
original behavior (on nightly v0.229):
updated behavior:
Before you mark this PR as ready for review, make sure that you have:
- [x] Added a solid test coverage and/or screenshots from doing manual
testing
- [x] Done a self-review taking into account security and performance
aspects
- [x] Aligned any UI changes with the [UI
checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist)
Release Notes:
- gopls: fixed semantic token support with gopls.
---
crates/languages/src/go.rs | 14 ++++++++++++--
1 file changed, 12 insertions(+), 2 deletions(-)
diff --git a/crates/languages/src/go.rs b/crates/languages/src/go.rs
index 5942a51f2a481b66cc8ba46072bd28c8285cbc07..8d945ba3b9e1b501d52675ada80bea41d394d4ed 100644
--- a/crates/languages/src/go.rs
+++ b/crates/languages/src/go.rs
@@ -5,7 +5,10 @@ use futures::StreamExt;
use gpui::{App, AsyncApp, Task};
use http_client::github::latest_github_release;
pub use language::*;
-use language::{LanguageToolchainStore, LspAdapterDelegate, LspInstaller};
+use language::{
+ LanguageName, LanguageToolchainStore, LspAdapterDelegate, LspInstaller,
+ language_settings::language_settings,
+};
use lsp::{LanguageServerBinary, LanguageServerName};
use project::lsp_store::language_server_settings;
@@ -207,6 +210,12 @@ impl LspAdapter for GoLspAdapter {
delegate: &Arc,
cx: &mut AsyncApp,
) -> Result