diff --git a/src/tint/lang/wgsl/ls/BUILD.bazel b/src/tint/lang/wgsl/ls/BUILD.bazel
index 57f5691..67c8c2a 100644
--- a/src/tint/lang/wgsl/ls/BUILD.bazel
+++ b/src/tint/lang/wgsl/ls/BUILD.bazel
@@ -44,6 +44,7 @@
     "file.cc",
     "serve.cc",
     "server.cc",
+    "symbols.cc",
   ],
   hdrs = [
     "file.h",
@@ -97,6 +98,7 @@
   srcs = [
     "diagnostics_test.cc",
     "helpers_test.h",
+    "symbols_test.cc",
   ],
   deps = [
     "//src/tint/lang/core",
diff --git a/src/tint/lang/wgsl/ls/BUILD.cmake b/src/tint/lang/wgsl/ls/BUILD.cmake
index 5c0e4ec..47dc1f4 100644
--- a/src/tint/lang/wgsl/ls/BUILD.cmake
+++ b/src/tint/lang/wgsl/ls/BUILD.cmake
@@ -49,6 +49,7 @@
   lang/wgsl/ls/serve.h
   lang/wgsl/ls/server.cc
   lang/wgsl/ls/server.h
+  lang/wgsl/ls/symbols.cc
   lang/wgsl/ls/utils.h
 )
 
@@ -105,6 +106,7 @@
 tint_add_target(tint_lang_wgsl_ls_test test
   lang/wgsl/ls/diagnostics_test.cc
   lang/wgsl/ls/helpers_test.h
+  lang/wgsl/ls/symbols_test.cc
 )
 
 tint_target_add_dependencies(tint_lang_wgsl_ls_test test
diff --git a/src/tint/lang/wgsl/ls/BUILD.gn b/src/tint/lang/wgsl/ls/BUILD.gn
index 4983b76..52190eb 100644
--- a/src/tint/lang/wgsl/ls/BUILD.gn
+++ b/src/tint/lang/wgsl/ls/BUILD.gn
@@ -52,6 +52,7 @@
       "serve.h",
       "server.cc",
       "server.h",
+      "symbols.cc",
       "utils.h",
     ]
     deps = [
@@ -97,6 +98,7 @@
       sources = [
         "diagnostics_test.cc",
         "helpers_test.h",
+        "symbols_test.cc",
       ]
       deps = [
         "${tint_src_dir}:gmock_and_gtest",
diff --git a/src/tint/lang/wgsl/ls/server.cc b/src/tint/lang/wgsl/ls/server.cc
index 710a5d0..e8e3791 100644
--- a/src/tint/lang/wgsl/ls/server.cc
+++ b/src/tint/lang/wgsl/ls/server.cc
@@ -38,6 +38,10 @@
 Server::Server(langsvr::Session& session) : session_(session) {
     session.Register([&](const lsp::InitializeRequest&) {
         lsp::InitializeResult result;
+        result.capabilities.document_symbol_provider = [] {
+            lsp::DocumentSymbolOptions opts;
+            return opts;
+        }();
         return result;
     });
 
@@ -46,11 +50,15 @@
         return lsp::Null{};
     });
 
+    // Notification handlers
     session.Register([&](const lsp::TextDocumentDidOpenNotification& n) { return Handle(n); });
     session.Register([&](const lsp::TextDocumentDidCloseNotification& n) { return Handle(n); });
     session.Register([&](const lsp::TextDocumentDidChangeNotification& n) { return Handle(n); });
     session.Register(
         [&](const lsp::WorkspaceDidChangeConfigurationNotification&) { return langsvr::Success; });
+
+    // Request handlers
+    session.Register([&](const lsp::TextDocumentDocumentSymbolRequest& r) { return Handle(r); });
 }
 
 Server::~Server() = default;
diff --git a/src/tint/lang/wgsl/ls/server.h b/src/tint/lang/wgsl/ls/server.h
index 10870b4..ab84a36 100644
--- a/src/tint/lang/wgsl/ls/server.h
+++ b/src/tint/lang/wgsl/ls/server.h
@@ -55,6 +55,10 @@
     bool ShuttingDown() const { return shutting_down_; }
 
   private:
+    /// Handler for langsvr::lsp::TextDocumentDocumentSymbolRequest
+    typename langsvr::lsp::TextDocumentDocumentSymbolRequest::ResultType  //
+    Handle(const langsvr::lsp::TextDocumentDocumentSymbolRequest& r);
+
     /// Handler for langsvr::lsp::TextDocumentDidOpenNotification
     langsvr::Result<langsvr::SuccessType>  //
     Handle(const langsvr::lsp::TextDocumentDidOpenNotification&);
diff --git a/src/tint/lang/wgsl/ls/symbols.cc b/src/tint/lang/wgsl/ls/symbols.cc
new file mode 100644
index 0000000..78771ba
--- /dev/null
+++ b/src/tint/lang/wgsl/ls/symbols.cc
@@ -0,0 +1,95 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+//    contributors may be used to endorse or promote products derived from
+//    this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include "src/tint/lang/wgsl/ast/const.h"
+#include "src/tint/lang/wgsl/ls/server.h"
+
+#include "src/tint/lang/wgsl/ast/alias.h"
+#include "src/tint/lang/wgsl/ast/identifier.h"
+#include "src/tint/lang/wgsl/ast/module.h"
+#include "src/tint/lang/wgsl/ast/struct.h"
+#include "src/tint/lang/wgsl/ls/utils.h"
+#include "src/tint/utils/rtti/switch.h"
+
+namespace tint::wgsl::ls {
+
+namespace lsp = langsvr::lsp;
+
+typename lsp::TextDocumentDocumentSymbolRequest::ResultType  //
+Server::Handle(const lsp::TextDocumentDocumentSymbolRequest& r) {
+    typename lsp::TextDocumentDocumentSymbolRequest::SuccessType result = lsp::Null{};
+
+    std::vector<lsp::DocumentSymbol> symbols;
+    if (auto file = files_.Get(r.text_document.uri)) {
+        for (auto* decl : (*file)->program.AST().Functions()) {
+            lsp::DocumentSymbol sym;
+            sym.range = Conv(decl->source.range);
+            sym.selection_range = Conv(decl->name->source.range);
+            sym.kind = lsp::SymbolKind::kFunction;
+            sym.name = decl->name->symbol.NameView();
+            symbols.push_back(sym);
+        }
+        for (auto* decl : (*file)->program.AST().GlobalVariables()) {
+            lsp::DocumentSymbol sym;
+            sym.range = Conv(decl->source.range);
+            sym.selection_range = Conv(decl->name->source.range);
+            sym.kind =
+                decl->Is<ast::Const>() ? lsp::SymbolKind::kConstant : lsp::SymbolKind::kVariable;
+            sym.name = decl->name->symbol.NameView();
+            symbols.push_back(sym);
+        }
+        for (auto* decl : (*file)->program.AST().TypeDecls()) {
+            Switch(
+                decl,  //
+                [&](const ast::Struct* str) {
+                    lsp::DocumentSymbol sym;
+                    sym.range = Conv(str->source.range);
+                    sym.selection_range = Conv(decl->name->source.range);
+                    sym.kind = lsp::SymbolKind::kStruct;
+                    sym.name = decl->name->symbol.NameView();
+                    symbols.push_back(sym);
+                },
+                [&](const ast::Alias* str) {
+                    lsp::DocumentSymbol sym;
+                    sym.range = Conv(str->source.range);
+                    sym.selection_range = Conv(decl->name->source.range);
+                    // TODO(bclayton): Is there a better symbol kind?
+                    sym.kind = lsp::SymbolKind::kObject;
+                    sym.name = decl->name->symbol.NameView();
+                    symbols.push_back(sym);
+                });
+        }
+    }
+
+    if (!symbols.empty()) {
+        result = std::move(symbols);
+    }
+
+    return result;
+}
+
+}  // namespace tint::wgsl::ls
diff --git a/src/tint/lang/wgsl/ls/symbols_test.cc b/src/tint/lang/wgsl/ls/symbols_test.cc
new file mode 100644
index 0000000..8899adf
--- /dev/null
+++ b/src/tint/lang/wgsl/ls/symbols_test.cc
@@ -0,0 +1,161 @@
+// Copyright 2024 The Dawn & Tint Authors
+//
+// Redistribution and use in source and binary forms, with or without
+// modification, are permitted provided that the following conditions are met:
+//
+// 1. Redistributions of source code must retain the above copyright notice, this
+//    list of conditions and the following disclaimer.
+//
+// 2. Redistributions in binary form must reproduce the above copyright notice,
+//    this list of conditions and the following disclaimer in the documentation
+//    and/or other materials provided with the distribution.
+//
+// 3. Neither the name of the copyright holder nor the names of its
+//    contributors may be used to endorse or promote products derived from
+//    this software without specific prior written permission.
+//
+// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
+// AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+// IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+// DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+// SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
+// CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+// OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+#include <string_view>
+
+#include "gmock/gmock.h"
+
+#include "langsvr/lsp/lsp.h"
+#include "langsvr/lsp/primitives.h"
+#include "langsvr/lsp/printer.h"
+#include "src/tint/lang/wgsl/ls/helpers_test.h"
+
+namespace tint::wgsl::ls {
+namespace {
+
+namespace lsp = langsvr::lsp;
+
+struct Case {
+    const std::string_view wgsl;
+    const std::vector<lsp::DocumentSymbol> symbols;
+};
+
+struct Symbol : lsp::DocumentSymbol {
+    explicit Symbol(std::string_view n) { name = n; }
+
+    Symbol& Kind(lsp::SymbolKind k) {
+        kind = k;
+        return *this;
+    }
+
+    Symbol& Range(lsp::Uinteger start_line,
+                  lsp::Uinteger start_column,
+                  lsp::Uinteger end_line,
+                  lsp::Uinteger end_column) {
+        range = lsp::Range{{start_line, start_column}, {end_line, end_column}};
+        return *this;
+    }
+
+    Symbol& SelectionRange(lsp::Uinteger start_line,
+                           lsp::Uinteger start_column,
+                           lsp::Uinteger end_line,
+                           lsp::Uinteger end_column) {
+        selection_range = lsp::Range{{start_line, start_column}, {end_line, end_column}};
+        return *this;
+    }
+};
+
+std::ostream& operator<<(std::ostream& stream, const Case& c) {
+    return stream << "wgsl: '" << c.wgsl << "'";
+}
+
+using LsSymbolsTest = LsTestWithParam<Case>;
+TEST_P(LsSymbolsTest, Symbols) {
+    lsp::TextDocumentDocumentSymbolRequest req{};
+    req.text_document.uri = OpenDocument(GetParam().wgsl);
+    auto future = client_session_.Send(req);
+    ASSERT_EQ(future, langsvr::Success);
+    auto res = future->get();
+    if (GetParam().symbols.empty()) {
+        ASSERT_TRUE(res.Is<lsp::Null>());
+    } else {
+        ASSERT_TRUE(res.Is<std::vector<lsp::DocumentSymbol>>());
+        EXPECT_THAT(*res.Get<std::vector<lsp::DocumentSymbol>>(),
+                    testing::ContainerEq(GetParam().symbols));
+    }
+}
+
+INSTANTIATE_TEST_SUITE_P(,
+                         LsSymbolsTest,
+                         ::testing::ValuesIn(std::vector<Case>{
+                             {
+                                 "",
+                                 {},
+                             },
+                             {
+                                 ""
+                                 /* 0 */ "const C = 1;\n"
+                                 /* 1 */ "/* blah */ var V : i32 = 2i;\n"
+                                 /* 2 */ "override O = 3f;\n",
+                                 {
+                                     Symbol{"C"}
+                                         .Kind(lsp::SymbolKind::kConstant)
+                                         .Range(0, 0, 0, 11)
+                                         .SelectionRange(0, 6, 0, 7),
+                                     Symbol{"V"}
+                                         .Kind(lsp::SymbolKind::kVariable)
+                                         .Range(1, 11, 1, 27)
+                                         .SelectionRange(1, 15, 1, 16),
+                                     Symbol{"O"}
+                                         .Kind(lsp::SymbolKind::kVariable)
+                                         .Range(2, 0, 2, 15)
+                                         .SelectionRange(2, 9, 2, 10),
+                                 },
+                             },
+                             {
+                                 ""
+                                 /* 0 */ "fn fa() {}\n"
+                                 /* 1 */ "/* blah */ fn fb() -> i32 {\n"
+                                 /* 2 */ "  return 1;\n"
+                                 /* 3 */ "} // blah",
+                                 {
+                                     Symbol{"fa"}
+                                         .Kind(lsp::SymbolKind::kFunction)
+                                         .Range(0, 0, 0, 10)
+                                         .SelectionRange(0, 3, 0, 5),
+                                     Symbol{"fb"}
+                                         .Kind(lsp::SymbolKind::kFunction)
+                                         .Range(1, 11, 3, 1)
+                                         .SelectionRange(1, 14, 1, 16),
+                                 },
+                             },
+                             {
+                                 ""
+                                 /* 0 */ "struct s1 { i : i32 }\n"
+                                 /* 1 */ "alias A = i32;\n"
+                                 /* 2 */ "/* blah */ struct s2 {\n"
+                                 /* 3 */ "  a : i32,\n"
+                                 /* 4 */ "} // blah",
+                                 {
+                                     Symbol{"s1"}
+                                         .Kind(lsp::SymbolKind::kStruct)
+                                         .Range(0, 0, 0, 21)
+                                         .SelectionRange(0, 7, 0, 9),
+                                     Symbol{"A"}
+                                         .Kind(lsp::SymbolKind::kObject)
+                                         .Range(1, 0, 1, 13)
+                                         .SelectionRange(1, 6, 1, 7),
+                                     Symbol{"s2"}
+                                         .Kind(lsp::SymbolKind::kStruct)
+                                         .Range(2, 11, 4, 1)
+                                         .SelectionRange(2, 18, 2, 20),
+                                 },
+                             },
+                         }));
+
+}  // namespace
+}  // namespace tint::wgsl::ls
