From b2a9d105e2e1d7fb3bd309f76fd1ba461615e963 Mon Sep 17 00:00:00 2001 From: l0ng-ai Date: Wed, 2 Dec 2026 18:29:03 +0800 Subject: [PATCH] feat(search): Endpoints tab in Search Everywhere and a Go to Endpoint action (#7510) The request mappings the IDE indexes were only a section of Search Everywhere's All tab. They now have their own Endpoints tab, as in IDEA Ultimate (also /endpoints), and Navigate > Go to Endpoint... opens it with the editor selection as the query. No default shortcut; bindable in Settings > Keymap. --- src/features/search/__tests__/everywhereModel.test.ts | 1 + .../search/__tests__/searchCategoryActions.test.ts | 7 +++++++ src/features/search/everywhere/model.ts | 3 ++- src/features/search/index.ts | 10 ++++++++++ src/platform/locales/text/zh.json | 1 + 5 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/features/search/__tests__/everywhereModel.test.ts b/src/features/search/__tests__/everywhereModel.test.ts index be116b345e..cf9e8ee901 100644 --- a/src/features/search/__tests__/everywhereModel.test.ts +++ b/src/features/search/__tests__/everywhereModel.test.ts @@ -394,6 +394,7 @@ describe("parseCommand", () => { "/classes", "/files", "/symbols", + "/endpoints", "/actions", "/text", ]); diff --git a/src/features/search/__tests__/searchCategoryActions.test.ts b/src/features/search/__tests__/searchCategoryActions.test.ts index d5eba925eb..ae17046037 100644 --- a/src/features/search/__tests__/searchCategoryActions.test.ts +++ b/src/features/search/__tests__/searchCategoryActions.test.ts @@ -47,3 +47,10 @@ describe("plugin search categories", () => { expect(getAction("navigate.searchEverywhere")).toBeDefined(); }); }); + +describe("Go to Endpoint", () => { + it("opens Search Everywhere on the indexed request mappings", async () => { + await executeAction("navigate.gotoEndpoint"); + expect(useSearchEverywhere.getState()).toMatchObject({ open: true, tab: "endpoints" }); + }); +}); diff --git a/src/features/search/everywhere/model.ts b/src/features/search/everywhere/model.ts index 58c363ccef..f65c907b21 100644 --- a/src/features/search/everywhere/model.ts +++ b/src/features/search/everywhere/model.ts @@ -10,7 +10,7 @@ import { basename, isTypeKind, relDir, symbolDisplayName } from "../common/open" import { byScore, matchText } from "../common/rank"; import { wordMatch } from "@/ui"; -export type SeTab = "all" | "classes" | "files" | "symbols" | "actions" | "text" | SearchCategoryId; +export type SeTab = "all" | "classes" | "files" | "symbols" | "endpoints" | "actions" | "text" | SearchCategoryId; export const isCustomTab = (tab: string): tab is SearchCategoryId => tab.startsWith("plugin:"); export function searchTabs(): ReadonlyArray<{ id: SeTab; label: string }> { return [...TABS, ...searchCategories().map((c) => ({ id: c.id, label: c.title }))]; @@ -34,6 +34,7 @@ export const TABS: ReadonlyArray<{ id: SeTab; label: string }> = [ { id: "classes", label: "Classes" }, { id: "files", label: "Files" }, { id: "symbols", label: "Symbols" }, + { id: "endpoints", label: "Endpoints" }, { id: "actions", label: "Actions" }, { id: "text", label: "Text" }, ]; diff --git a/src/features/search/index.ts b/src/features/search/index.ts index 05da518414..4d9e98f835 100644 --- a/src/features/search/index.ts +++ b/src/features/search/index.ts @@ -377,6 +377,16 @@ export function activate(): void | (() => void) { when: "projectOpen", run: se("symbols"), }, + { + // The request mappings the IDE indexed (Search Everywhere's Endpoints): type a URL, open its + // handler. No default shortcut; RestfulToolkit users bind `Ctrl+\` in Settings › Keymap. + id: "navigate.gotoEndpoint", + title: "Go to Endpoint…", + category: "Navigate", + keywords: ["url", "route", "request mapping", "service url"], + when: "projectOpen", + run: se("endpoints"), + }, { id: "navigate.findAction", title: "Find Action…", diff --git a/src/platform/locales/text/zh.json b/src/platform/locales/text/zh.json index c03786e99d..7f63cfb213 100644 --- a/src/platform/locales/text/zh.json +++ b/src/platform/locales/text/zh.json @@ -455,6 +455,7 @@ "Also show the other platform's shortcut": "同时显示另一平台的快捷键", "macOS shortcuts on Windows and Linux, Windows/Linux shortcuts on macOS.": "在 Windows 和 Linux 上显示 macOS 快捷键,在 macOS 上显示 Windows/Linux 快捷键。", "Trust Project in Codex": "在 Codex 中信任项目", + "Go to Endpoint…": "转到端点…", "Go to Feign Endpoint": "跳转到 Feign 端点", "Find Feign Clients": "查找 Feign 客户端", "Feign Clients": "Feign 客户端",