Порівняти коміти

...
Автор SHA1 Повідомлення Дата
l0ng-ai b5ac7ca5b3 fix(project-tree): add Select Opened File as a Project View action for the keymap
The keymap listed "Select Opened File" only as the Database view's action
(db.selectOpened); the Project view's locate button ran Select in Project
View, which the keymap shows under another name. A shortcut assigned to
"Select Opened File" therefore revealed the file in the Database view and
did nothing in a project without databases. Like IDEA's
SelectOpenedFileInProjectView, the Project view now has its own Select
Opened File action (the toolbar button runs it), and imported IDEA keymaps
map SelectOpenedFileInProjectView and SelectInProjectView.

Fixes #6978
2026-11-30 18:18:24 +08:00
6 змінених файлів з 28 додано та 2 видалено

No files matched your search

+2 -2
Переглянути файл
@@ -100,9 +100,9 @@ export function ProjectHeaderActions() {
{!alwaysSelect && (
<IconButton
icon="locate"
action="navigate.selectInProjectView"
action="project.selectOpenedFile"
title="Select Opened File"
shortcut={shortcutLabel("navigate.selectInProjectView")}
shortcut={shortcutLabel("project.selectOpenedFile")}
size="small"
/>
)}
+10
Переглянути файл
@@ -254,6 +254,16 @@ export function registerProjectActions(): () => void {
keywords: ["locate", "reveal", "scroll from source", "select opened file"],
run: ({ arg }) => void selectInProjectView(typeof arg === "string" ? arg : null),
},
{
// IDEA's SelectOpenedFileInProjectView: the Project view toolbar's locate button.
id: "project.selectOpenedFile",
title: "Select Opened File",
category: "Project View",
icon: "locate",
when: OPEN,
keywords: ["locate", "reveal", "scroll from source", "select in project view"],
run: () => void selectInProjectView(null),
},
{
id: "project.reveal",
title: "Reveal in Project View",
+12
Переглянути файл
@@ -152,6 +152,18 @@ describe("Select In (⌥F1)", () => {
expect(useContextMenuStore.getState().menu).toBeNull();
});
it("Select Opened File is a Project View action of its own, as in IDEA's keymap", async () => {
const { IDEA_ACTIONS } = await import("@/platform/ideaActions");
disposers.push(registerProjectActions(), () => setContext("projectOpen", false));
setContext("projectOpen", true);
expect(getAction("project.selectOpenedFile")).toMatchObject({
title: "Select Opened File",
category: "Project View",
});
expect(IDEA_ACTIONS.SelectOpenedFileInProjectView).toBe("project.selectOpenedFile");
expect(IDEA_ACTIONS.SelectInProjectView).toBe("navigate.selectInProjectView");
});
it("expands an in-project folder when expand is true and reveals out-of-project folders in the file manager", async () => {
const { useProjectTree } = await import("./store");
const prev = useProjectTree.getState();
+2
Переглянути файл
@@ -6,6 +6,8 @@ export const IDEA_ACTIONS: Readonly<Record<string, string>> = {
GotoDeclaration: "navigate.declaration",
GotoImplementation: "navigate.implementation",
GotoTypeDeclaration: "navigate.typeDeclaration",
SelectInProjectView: "navigate.selectInProjectView",
SelectOpenedFileInProjectView: "project.selectOpenedFile",
GotoSuperMethod: "navigate.superMethod",
GotoTest: "navigate.gotoTest",
GotoRelated: "navigate.relatedSymbol",
+1
Переглянути файл
@@ -531,6 +531,7 @@ export const intellijMacos: Record<string, string[]> = {
"db.showDiagram": ["Meta+Alt+Shift+U"],
"db.showDiagramPopup": ["Meta+Alt+U"],
"db.selectOpened": [],
"project.selectOpenedFile": [],
"db.expandAll": [],
"db.collapseAll": [],
// Terminal (keyWhen: terminalFocus); after VCS Update / Go to Test so it wins there.
+1
Переглянути файл
@@ -529,6 +529,7 @@ export const intellijWindows: Record<string, string[]> = {
"db.showDiagram": ["Ctrl+Alt+Shift+U"],
"db.showDiagramPopup": ["Ctrl+Alt+U"],
"db.selectOpened": [],
"project.selectOpenedFile": [],
"db.expandAll": [],
"db.collapseAll": [],
// Terminal (keyWhen: terminalFocus); after VCS Update / Go to Test so it wins there.