@finos/legend-application-pure-ide 6.2.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +3 -0
- package/lib/application/LegendPureIDE.d.ts +26 -0
- package/lib/application/LegendPureIDE.d.ts.map +1 -0
- package/lib/application/LegendPureIDE.js +43 -0
- package/lib/application/LegendPureIDE.js.map +1 -0
- package/lib/application/LegendPureIDEApplicationConfig.d.ts +28 -0
- package/lib/application/LegendPureIDEApplicationConfig.d.ts.map +1 -0
- package/lib/application/LegendPureIDEApplicationConfig.js +30 -0
- package/lib/application/LegendPureIDEApplicationConfig.js.map +1 -0
- package/lib/application/LegendPureIDEPluginManager.d.ts +32 -0
- package/lib/application/LegendPureIDEPluginManager.d.ts.map +1 -0
- package/lib/application/LegendPureIDEPluginManager.js +46 -0
- package/lib/application/LegendPureIDEPluginManager.js.map +1 -0
- package/lib/components/Core_LegendPureIDEApplicationPlugin.d.ts +23 -0
- package/lib/components/Core_LegendPureIDEApplicationPlugin.d.ts.map +1 -0
- package/lib/components/Core_LegendPureIDEApplicationPlugin.js +29 -0
- package/lib/components/Core_LegendPureIDEApplicationPlugin.js.map +1 -0
- package/lib/components/LegendPureIDEApplication.d.ts +18 -0
- package/lib/components/LegendPureIDEApplication.d.ts.map +1 -0
- package/lib/components/LegendPureIDEApplication.js +21 -0
- package/lib/components/LegendPureIDEApplication.js.map +1 -0
- package/lib/components/LegendPureIDEBaseStoreProvider.d.ts +23 -0
- package/lib/components/LegendPureIDEBaseStoreProvider.d.ts.map +1 -0
- package/lib/components/LegendPureIDEBaseStoreProvider.js +30 -0
- package/lib/components/LegendPureIDEBaseStoreProvider.js.map +1 -0
- package/lib/components/editor/ActivityBar.d.ts +20 -0
- package/lib/components/editor/ActivityBar.d.ts.map +1 -0
- package/lib/components/editor/ActivityBar.js +41 -0
- package/lib/components/editor/ActivityBar.js.map +1 -0
- package/lib/components/editor/Editor.d.ts +18 -0
- package/lib/components/editor/Editor.d.ts.map +1 -0
- package/lib/components/editor/Editor.js +80 -0
- package/lib/components/editor/Editor.js.map +1 -0
- package/lib/components/editor/EditorStoreProvider.d.ts +22 -0
- package/lib/components/editor/EditorStoreProvider.d.ts.map +1 -0
- package/lib/components/editor/EditorStoreProvider.js +32 -0
- package/lib/components/editor/EditorStoreProvider.js.map +1 -0
- package/lib/components/editor/StatusBar.d.ts +22 -0
- package/lib/components/editor/StatusBar.d.ts.map +1 -0
- package/lib/components/editor/StatusBar.js +39 -0
- package/lib/components/editor/StatusBar.js.map +1 -0
- package/lib/components/editor/aux-panel/AuxiliaryPanel.d.ts +20 -0
- package/lib/components/editor/aux-panel/AuxiliaryPanel.d.ts.map +1 -0
- package/lib/components/editor/aux-panel/AuxiliaryPanel.js +65 -0
- package/lib/components/editor/aux-panel/AuxiliaryPanel.js.map +1 -0
- package/lib/components/editor/aux-panel/ConsolePanel.d.ts +20 -0
- package/lib/components/editor/aux-panel/ConsolePanel.d.ts.map +1 -0
- package/lib/components/editor/aux-panel/ConsolePanel.js +24 -0
- package/lib/components/editor/aux-panel/ConsolePanel.js.map +1 -0
- package/lib/components/editor/aux-panel/SearchPanel.d.ts +20 -0
- package/lib/components/editor/aux-panel/SearchPanel.d.ts.map +1 -0
- package/lib/components/editor/aux-panel/SearchPanel.js +90 -0
- package/lib/components/editor/aux-panel/SearchPanel.js.map +1 -0
- package/lib/components/editor/aux-panel/TestRunnerPanel.d.ts +20 -0
- package/lib/components/editor/aux-panel/TestRunnerPanel.d.ts.map +1 -0
- package/lib/components/editor/aux-panel/TestRunnerPanel.js +151 -0
- package/lib/components/editor/aux-panel/TestRunnerPanel.js.map +1 -0
- package/lib/components/editor/command-center/CreateNewDirectoryCommand.d.ts +20 -0
- package/lib/components/editor/command-center/CreateNewDirectoryCommand.d.ts.map +1 -0
- package/lib/components/editor/command-center/CreateNewDirectoryCommand.js +48 -0
- package/lib/components/editor/command-center/CreateNewDirectoryCommand.js.map +1 -0
- package/lib/components/editor/command-center/CreateNewFileCommand.d.ts +20 -0
- package/lib/components/editor/command-center/CreateNewFileCommand.d.ts.map +1 -0
- package/lib/components/editor/command-center/CreateNewFileCommand.js +48 -0
- package/lib/components/editor/command-center/CreateNewFileCommand.js.map +1 -0
- package/lib/components/editor/command-center/FileSearchCommand.d.ts +20 -0
- package/lib/components/editor/command-center/FileSearchCommand.d.ts.map +1 -0
- package/lib/components/editor/command-center/FileSearchCommand.js +60 -0
- package/lib/components/editor/command-center/FileSearchCommand.js.map +1 -0
- package/lib/components/editor/command-center/TextSearchCommand.d.ts +20 -0
- package/lib/components/editor/command-center/TextSearchCommand.d.ts.map +1 -0
- package/lib/components/editor/command-center/TextSearchCommand.js +50 -0
- package/lib/components/editor/command-center/TextSearchCommand.js.map +1 -0
- package/lib/components/editor/edit-panel/DiagramEditor.d.ts +23 -0
- package/lib/components/editor/edit-panel/DiagramEditor.d.ts.map +1 -0
- package/lib/components/editor/edit-panel/DiagramEditor.js +71 -0
- package/lib/components/editor/edit-panel/DiagramEditor.js.map +1 -0
- package/lib/components/editor/edit-panel/EditPanel.d.ts +21 -0
- package/lib/components/editor/edit-panel/EditPanel.d.ts.map +1 -0
- package/lib/components/editor/edit-panel/EditPanel.js +55 -0
- package/lib/components/editor/edit-panel/EditPanel.js.map +1 -0
- package/lib/components/editor/edit-panel/FileEditor.d.ts +23 -0
- package/lib/components/editor/edit-panel/FileEditor.d.ts.map +1 -0
- package/lib/components/editor/edit-panel/FileEditor.js +114 -0
- package/lib/components/editor/edit-panel/FileEditor.js.map +1 -0
- package/lib/components/editor/shared/ConceptIconUtils.d.ts +17 -0
- package/lib/components/editor/shared/ConceptIconUtils.d.ts.map +1 -0
- package/lib/components/editor/shared/ConceptIconUtils.js +50 -0
- package/lib/components/editor/shared/ConceptIconUtils.js.map +1 -0
- package/lib/components/editor/side-bar/ConceptTreeExplorer.d.ts +24 -0
- package/lib/components/editor/side-bar/ConceptTreeExplorer.d.ts.map +1 -0
- package/lib/components/editor/side-bar/ConceptTreeExplorer.js +165 -0
- package/lib/components/editor/side-bar/ConceptTreeExplorer.js.map +1 -0
- package/lib/components/editor/side-bar/DirectoryTreeExplorer.d.ts +20 -0
- package/lib/components/editor/side-bar/DirectoryTreeExplorer.d.ts.map +1 -0
- package/lib/components/editor/side-bar/DirectoryTreeExplorer.js +142 -0
- package/lib/components/editor/side-bar/DirectoryTreeExplorer.js.map +1 -0
- package/lib/components/editor/side-bar/SideBar.d.ts +23 -0
- package/lib/components/editor/side-bar/SideBar.d.ts.map +1 -0
- package/lib/components/editor/side-bar/SideBar.js +40 -0
- package/lib/components/editor/side-bar/SideBar.js.map +1 -0
- package/lib/extensions.css +17 -0
- package/lib/extensions.css.map +1 -0
- package/lib/index.css +17 -0
- package/lib/index.css.map +1 -0
- package/lib/index.d.ts +22 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +39 -0
- package/lib/index.js.map +1 -0
- package/lib/package.json +85 -0
- package/lib/server/PureServerClient.d.ts +55 -0
- package/lib/server/PureServerClient.d.ts.map +1 -0
- package/lib/server/PureServerClient.js +120 -0
- package/lib/server/PureServerClient.js.map +1 -0
- package/lib/server/models/Command.d.ts +24 -0
- package/lib/server/models/Command.d.ts.map +1 -0
- package/lib/server/models/Command.js +35 -0
- package/lib/server/models/Command.js.map +1 -0
- package/lib/server/models/ConceptTree.d.ts +76 -0
- package/lib/server/models/ConceptTree.d.ts.map +1 -0
- package/lib/server/models/ConceptTree.js +116 -0
- package/lib/server/models/ConceptTree.js.map +1 -0
- package/lib/server/models/DiagramInfo.d.ts +144 -0
- package/lib/server/models/DiagramInfo.d.ts.map +1 -0
- package/lib/server/models/DiagramInfo.js +478 -0
- package/lib/server/models/DiagramInfo.js.map +1 -0
- package/lib/server/models/DirectoryTree.d.ts +37 -0
- package/lib/server/models/DirectoryTree.d.ts.map +1 -0
- package/lib/server/models/DirectoryTree.js +70 -0
- package/lib/server/models/DirectoryTree.js.map +1 -0
- package/lib/server/models/Execution.d.ts +100 -0
- package/lib/server/models/Execution.d.ts.map +1 -0
- package/lib/server/models/Execution.js +183 -0
- package/lib/server/models/Execution.js.map +1 -0
- package/lib/server/models/Initialization.d.ts +49 -0
- package/lib/server/models/Initialization.d.ts.map +1 -0
- package/lib/server/models/Initialization.js +64 -0
- package/lib/server/models/Initialization.js.map +1 -0
- package/lib/server/models/PureFile.d.ts +34 -0
- package/lib/server/models/PureFile.d.ts.map +1 -0
- package/lib/server/models/PureFile.js +56 -0
- package/lib/server/models/PureFile.js.map +1 -0
- package/lib/server/models/SearchEntry.d.ts +36 -0
- package/lib/server/models/SearchEntry.d.ts.map +1 -0
- package/lib/server/models/SearchEntry.js +63 -0
- package/lib/server/models/SearchEntry.js.map +1 -0
- package/lib/server/models/SourceInformation.d.ts +25 -0
- package/lib/server/models/SourceInformation.d.ts.map +1 -0
- package/lib/server/models/SourceInformation.js +35 -0
- package/lib/server/models/SourceInformation.js.map +1 -0
- package/lib/server/models/Test.d.ts +57 -0
- package/lib/server/models/Test.d.ts.map +1 -0
- package/lib/server/models/Test.js +92 -0
- package/lib/server/models/Test.js.map +1 -0
- package/lib/server/models/Usage.d.ts +31 -0
- package/lib/server/models/Usage.d.ts.map +1 -0
- package/lib/server/models/Usage.js +36 -0
- package/lib/server/models/Usage.js.map +1 -0
- package/lib/stores/ConceptTreeState.d.ts +34 -0
- package/lib/stores/ConceptTreeState.d.ts.map +1 -0
- package/lib/stores/ConceptTreeState.js +117 -0
- package/lib/stores/ConceptTreeState.js.map +1 -0
- package/lib/stores/DiagramEditorState.d.ts +40 -0
- package/lib/stores/DiagramEditorState.d.ts.map +1 -0
- package/lib/stores/DiagramEditorState.js +90 -0
- package/lib/stores/DiagramEditorState.js.map +1 -0
- package/lib/stores/DirectoryTreeState.d.ts +35 -0
- package/lib/stores/DirectoryTreeState.d.ts.map +1 -0
- package/lib/stores/DirectoryTreeState.js +119 -0
- package/lib/stores/DirectoryTreeState.js.map +1 -0
- package/lib/stores/EditorConfig.d.ts +25 -0
- package/lib/stores/EditorConfig.d.ts.map +1 -0
- package/lib/stores/EditorConfig.js +27 -0
- package/lib/stores/EditorConfig.js.map +1 -0
- package/lib/stores/EditorStore.d.ts +102 -0
- package/lib/stores/EditorStore.d.ts.map +1 -0
- package/lib/stores/EditorStore.js +761 -0
- package/lib/stores/EditorStore.js.map +1 -0
- package/lib/stores/EditorTabManagerState.d.ts +31 -0
- package/lib/stores/EditorTabManagerState.d.ts.map +1 -0
- package/lib/stores/EditorTabManagerState.js +62 -0
- package/lib/stores/EditorTabManagerState.js.map +1 -0
- package/lib/stores/FileEditorState.d.ts +37 -0
- package/lib/stores/FileEditorState.d.ts.map +1 -0
- package/lib/stores/FileEditorState.js +99 -0
- package/lib/stores/FileEditorState.js.map +1 -0
- package/lib/stores/LegendPureIDEApplicationPlugin.d.ts +26 -0
- package/lib/stores/LegendPureIDEApplicationPlugin.d.ts.map +1 -0
- package/lib/stores/LegendPureIDEApplicationPlugin.js +27 -0
- package/lib/stores/LegendPureIDEApplicationPlugin.js.map +1 -0
- package/lib/stores/LegendPureIDEBaseStore.d.ts +25 -0
- package/lib/stores/LegendPureIDEBaseStore.d.ts.map +1 -0
- package/lib/stores/LegendPureIDEBaseStore.js +25 -0
- package/lib/stores/LegendPureIDEBaseStore.js.map +1 -0
- package/lib/stores/LegendPureIDECommand.d.ts +32 -0
- package/lib/stores/LegendPureIDECommand.d.ts.map +1 -0
- package/lib/stores/LegendPureIDECommand.js +82 -0
- package/lib/stores/LegendPureIDECommand.js.map +1 -0
- package/lib/stores/SearchCommandState.d.ts +28 -0
- package/lib/stores/SearchCommandState.d.ts.map +1 -0
- package/lib/stores/SearchCommandState.js +53 -0
- package/lib/stores/SearchCommandState.js.map +1 -0
- package/lib/stores/SearchResultState.d.ts +43 -0
- package/lib/stores/SearchResultState.d.ts.map +1 -0
- package/lib/stores/SearchResultState.js +92 -0
- package/lib/stores/SearchResultState.js.map +1 -0
- package/lib/stores/TestRunnerState.d.ts +87 -0
- package/lib/stores/TestRunnerState.d.ts.map +1 -0
- package/lib/stores/TestRunnerState.js +336 -0
- package/lib/stores/TestRunnerState.js.map +1 -0
- package/lib/stores/TreeState.d.ts +42 -0
- package/lib/stores/TreeState.d.ts.map +1 -0
- package/lib/stores/TreeState.js +139 -0
- package/lib/stores/TreeState.js.map +1 -0
- package/package.json +85 -0
- package/src/application/LegendPureIDE.tsx +73 -0
- package/src/application/LegendPureIDEApplicationConfig.ts +58 -0
- package/src/application/LegendPureIDEPluginManager.ts +67 -0
- package/src/components/Core_LegendPureIDEApplicationPlugin.tsx +37 -0
- package/src/components/LegendPureIDEApplication.tsx +27 -0
- package/src/components/LegendPureIDEBaseStoreProvider.tsx +57 -0
- package/src/components/editor/ActivityBar.tsx +74 -0
- package/src/components/editor/Editor.tsx +180 -0
- package/src/components/editor/EditorStoreProvider.tsx +57 -0
- package/src/components/editor/StatusBar.tsx +95 -0
- package/src/components/editor/aux-panel/AuxiliaryPanel.tsx +155 -0
- package/src/components/editor/aux-panel/ConsolePanel.tsx +49 -0
- package/src/components/editor/aux-panel/SearchPanel.tsx +421 -0
- package/src/components/editor/aux-panel/TestRunnerPanel.tsx +455 -0
- package/src/components/editor/command-center/CreateNewDirectoryCommand.tsx +86 -0
- package/src/components/editor/command-center/CreateNewFileCommand.tsx +84 -0
- package/src/components/editor/command-center/FileSearchCommand.tsx +112 -0
- package/src/components/editor/command-center/TextSearchCommand.tsx +103 -0
- package/src/components/editor/edit-panel/DiagramEditor.tsx +108 -0
- package/src/components/editor/edit-panel/EditPanel.tsx +114 -0
- package/src/components/editor/edit-panel/FileEditor.tsx +156 -0
- package/src/components/editor/shared/ConceptIconUtils.tsx +78 -0
- package/src/components/editor/side-bar/ConceptTreeExplorer.tsx +401 -0
- package/src/components/editor/side-bar/DirectoryTreeExplorer.tsx +366 -0
- package/src/components/editor/side-bar/SideBar.tsx +51 -0
- package/src/index.tsx +46 -0
- package/src/server/PureServerClient.ts +299 -0
- package/src/server/models/Command.ts +40 -0
- package/src/server/models/ConceptTree.ts +152 -0
- package/src/server/models/DiagramInfo.ts +793 -0
- package/src/server/models/DirectoryTree.ts +100 -0
- package/src/server/models/Execution.ts +223 -0
- package/src/server/models/Initialization.ts +92 -0
- package/src/server/models/PureFile.ts +76 -0
- package/src/server/models/SearchEntry.ts +85 -0
- package/src/server/models/SourceInformation.ts +37 -0
- package/src/server/models/Test.ts +125 -0
- package/src/server/models/Usage.ts +49 -0
- package/src/stores/ConceptTreeState.ts +156 -0
- package/src/stores/DiagramEditorState.ts +150 -0
- package/src/stores/DirectoryTreeState.ts +168 -0
- package/src/stores/EditorConfig.ts +26 -0
- package/src/stores/EditorStore.ts +1087 -0
- package/src/stores/EditorTabManagerState.ts +74 -0
- package/src/stores/FileEditorState.ts +148 -0
- package/src/stores/LegendPureIDEApplicationPlugin.ts +30 -0
- package/src/stores/LegendPureIDEBaseStore.ts +36 -0
- package/src/stores/LegendPureIDECommand.ts +84 -0
- package/src/stores/SearchCommandState.ts +61 -0
- package/src/stores/SearchResultState.ts +131 -0
- package/src/stores/TestRunnerState.ts +470 -0
- package/src/stores/TreeState.ts +179 -0
- package/tsconfig.json +98 -0
|
@@ -0,0 +1,421 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright (c) 2020-present, Goldman Sachs
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import { observer } from 'mobx-react-lite';
|
|
18
|
+
import type {
|
|
19
|
+
SearchResultCoordinate,
|
|
20
|
+
SearchResultEntry,
|
|
21
|
+
} from '../../../server/models/SearchEntry.js';
|
|
22
|
+
import {
|
|
23
|
+
FileCoordinate,
|
|
24
|
+
trimPathLeadingSlash,
|
|
25
|
+
} from '../../../server/models/PureFile.js';
|
|
26
|
+
import { flowResult } from 'mobx';
|
|
27
|
+
import {
|
|
28
|
+
SearchResultState,
|
|
29
|
+
UnmatchedFunctionExecutionResultState,
|
|
30
|
+
UnmatchExecutionResultState,
|
|
31
|
+
UsageResultState,
|
|
32
|
+
} from '../../../stores/SearchResultState.js';
|
|
33
|
+
import type {
|
|
34
|
+
CandidateWithPackageImported,
|
|
35
|
+
CandidateWithPackageNotImported,
|
|
36
|
+
} from '../../../server/models/Execution.js';
|
|
37
|
+
import { getUsageConceptLabel } from '../../../server/models/Usage.js';
|
|
38
|
+
import {
|
|
39
|
+
ArrowCircleRightIcon,
|
|
40
|
+
BlankPanelContent,
|
|
41
|
+
FileAltIcon,
|
|
42
|
+
PanelLoadingIndicator,
|
|
43
|
+
PlusIcon,
|
|
44
|
+
TimesIcon,
|
|
45
|
+
} from '@finos/legend-art';
|
|
46
|
+
import { useApplicationStore } from '@finos/legend-application';
|
|
47
|
+
import { useEditorStore } from '../EditorStoreProvider.js';
|
|
48
|
+
|
|
49
|
+
const SearchResultEntryDisplay = observer(
|
|
50
|
+
(props: {
|
|
51
|
+
searchState: SearchResultState;
|
|
52
|
+
searchEntry: SearchResultEntry;
|
|
53
|
+
}) => {
|
|
54
|
+
const { searchState, searchEntry } = props;
|
|
55
|
+
const editorStore = useEditorStore();
|
|
56
|
+
const applicationStore = useApplicationStore();
|
|
57
|
+
const goToResult =
|
|
58
|
+
(coordinate: SearchResultCoordinate): (() => void) =>
|
|
59
|
+
(): Promise<void> =>
|
|
60
|
+
flowResult(
|
|
61
|
+
editorStore.loadFile(
|
|
62
|
+
searchEntry.sourceId,
|
|
63
|
+
new FileCoordinate(
|
|
64
|
+
searchEntry.sourceId,
|
|
65
|
+
coordinate.startLine,
|
|
66
|
+
coordinate.startColumn,
|
|
67
|
+
),
|
|
68
|
+
),
|
|
69
|
+
).catch(applicationStore.alertUnhandledError);
|
|
70
|
+
const dismissResultForFile = (): void =>
|
|
71
|
+
searchState.dismissSearchEntry(searchEntry);
|
|
72
|
+
const dismissCoordinate =
|
|
73
|
+
(coordinate: SearchResultCoordinate): (() => void) =>
|
|
74
|
+
(): void => {
|
|
75
|
+
searchEntry.dismissCoordinate(coordinate);
|
|
76
|
+
if (!searchEntry.coordinates.length) {
|
|
77
|
+
searchState.dismissSearchEntry(searchEntry);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
return (
|
|
82
|
+
<div className="search-panel__entry">
|
|
83
|
+
<div className="search-panel__entry__header">
|
|
84
|
+
<div className="search-panel__entry__header__title">
|
|
85
|
+
<div className="search-panel__entry__header__title__label">
|
|
86
|
+
<FileAltIcon />
|
|
87
|
+
</div>
|
|
88
|
+
<div className="search-panel__entry__header__title__content">
|
|
89
|
+
{trimPathLeadingSlash(searchEntry.sourceId)}
|
|
90
|
+
</div>
|
|
91
|
+
</div>
|
|
92
|
+
<div className="search-panel__entry__header__actions">
|
|
93
|
+
<div className="search-panel__entry__header__action search-panel__entry__header__action--with-counter">
|
|
94
|
+
<div className="search-panel__entry__header__action__counter">
|
|
95
|
+
{searchEntry.coordinates.length}
|
|
96
|
+
</div>
|
|
97
|
+
</div>
|
|
98
|
+
<button
|
|
99
|
+
className="search-panel__entry__header__action search-panel__entry__header__action--hidden"
|
|
100
|
+
tabIndex={-1}
|
|
101
|
+
title="Dismiss"
|
|
102
|
+
onClick={dismissResultForFile}
|
|
103
|
+
>
|
|
104
|
+
<TimesIcon />
|
|
105
|
+
</button>
|
|
106
|
+
</div>
|
|
107
|
+
</div>
|
|
108
|
+
<div className="search-panel__entry__content">
|
|
109
|
+
{searchEntry.coordinates.map((coordinate) => (
|
|
110
|
+
<div
|
|
111
|
+
key={coordinate.uuid}
|
|
112
|
+
className="search-panel__entry__content__item"
|
|
113
|
+
>
|
|
114
|
+
<div
|
|
115
|
+
className="search-panel__entry__content__item__label search-panel__entry__content__item__label--full"
|
|
116
|
+
title="Go to Result"
|
|
117
|
+
onClick={goToResult(coordinate)}
|
|
118
|
+
>
|
|
119
|
+
{`line: ${coordinate.startLine} - column: ${coordinate.startColumn}`}
|
|
120
|
+
</div>
|
|
121
|
+
<div className="search-panel__entry__content__item__actions">
|
|
122
|
+
<button
|
|
123
|
+
className="search-panel__entry__content__item__action search-panel__entry__content__item__action--hidden"
|
|
124
|
+
tabIndex={-1}
|
|
125
|
+
title="Dismiss"
|
|
126
|
+
onClick={dismissCoordinate(coordinate)}
|
|
127
|
+
>
|
|
128
|
+
<TimesIcon />
|
|
129
|
+
</button>
|
|
130
|
+
</div>
|
|
131
|
+
</div>
|
|
132
|
+
))}
|
|
133
|
+
</div>
|
|
134
|
+
</div>
|
|
135
|
+
);
|
|
136
|
+
},
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
const SearchResultDisplay = observer(
|
|
140
|
+
(props: { searchState: SearchResultState }) => {
|
|
141
|
+
const { searchState } = props;
|
|
142
|
+
const editorStore = useEditorStore();
|
|
143
|
+
if (!searchState.searchEntries.length) {
|
|
144
|
+
return (
|
|
145
|
+
<BlankPanelContent>{`No occurrences found for '${editorStore.textSearchCommandState.text}'`}</BlankPanelContent>
|
|
146
|
+
);
|
|
147
|
+
}
|
|
148
|
+
return (
|
|
149
|
+
<div className="search-panel__content">
|
|
150
|
+
<div className="search-panel__content__header">{`Showing ${searchState.numberOfResults} result(s) in ${searchState.numberOfFiles} files for '${editorStore.textSearchCommandState.text}'`}</div>
|
|
151
|
+
{searchState.searchEntries.map((searchEntry) => (
|
|
152
|
+
<SearchResultEntryDisplay
|
|
153
|
+
key={searchEntry.uuid}
|
|
154
|
+
searchState={searchState}
|
|
155
|
+
searchEntry={searchEntry}
|
|
156
|
+
/>
|
|
157
|
+
))}
|
|
158
|
+
</div>
|
|
159
|
+
);
|
|
160
|
+
},
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
const UsageResultDisplay = observer(
|
|
164
|
+
(props: { usageState: UsageResultState }) => {
|
|
165
|
+
const { usageState } = props;
|
|
166
|
+
if (!usageState.searchEntries.length) {
|
|
167
|
+
return (
|
|
168
|
+
<BlankPanelContent>{`No usages found for ${getUsageConceptLabel(
|
|
169
|
+
usageState.usageConcept,
|
|
170
|
+
)}`}</BlankPanelContent>
|
|
171
|
+
);
|
|
172
|
+
}
|
|
173
|
+
return (
|
|
174
|
+
<div className="search-panel__content">
|
|
175
|
+
<div className="search-panel__content__header">{`Showing ${
|
|
176
|
+
usageState.numberOfResults
|
|
177
|
+
} usages(s) in ${
|
|
178
|
+
usageState.numberOfFiles
|
|
179
|
+
} files for ${getUsageConceptLabel(usageState.usageConcept)}`}</div>
|
|
180
|
+
{usageState.searchEntries.map((searchEntry) => (
|
|
181
|
+
<SearchResultEntryDisplay
|
|
182
|
+
key={searchEntry.uuid}
|
|
183
|
+
searchState={usageState}
|
|
184
|
+
searchEntry={searchEntry}
|
|
185
|
+
/>
|
|
186
|
+
))}
|
|
187
|
+
</div>
|
|
188
|
+
);
|
|
189
|
+
},
|
|
190
|
+
);
|
|
191
|
+
|
|
192
|
+
const CandidateWithPackageImportedDisplay = observer(
|
|
193
|
+
(props: { candidate: CandidateWithPackageImported }) => {
|
|
194
|
+
const { candidate } = props;
|
|
195
|
+
const editorStore = useEditorStore();
|
|
196
|
+
const applicationStore = useApplicationStore();
|
|
197
|
+
const goToResult = (): void => {
|
|
198
|
+
flowResult(
|
|
199
|
+
editorStore.loadFile(
|
|
200
|
+
candidate.sourceID,
|
|
201
|
+
new FileCoordinate(
|
|
202
|
+
candidate.sourceID,
|
|
203
|
+
candidate.line,
|
|
204
|
+
candidate.column,
|
|
205
|
+
),
|
|
206
|
+
),
|
|
207
|
+
).catch(applicationStore.alertUnhandledError);
|
|
208
|
+
};
|
|
209
|
+
|
|
210
|
+
return (
|
|
211
|
+
<div className="search-panel__entry__content__item">
|
|
212
|
+
<div
|
|
213
|
+
className="search-panel__entry__content__item__label__candidate"
|
|
214
|
+
title="Go to Result"
|
|
215
|
+
onClick={goToResult}
|
|
216
|
+
>
|
|
217
|
+
<div className="search-panel__entry__content__item__label__candidate-name">
|
|
218
|
+
{candidate.foundName}
|
|
219
|
+
</div>
|
|
220
|
+
<div className="search-panel__entry__content__item__label__candidate-location">
|
|
221
|
+
{`${trimPathLeadingSlash(candidate.sourceID)} [${candidate.line}:${
|
|
222
|
+
candidate.column
|
|
223
|
+
}]`}
|
|
224
|
+
</div>
|
|
225
|
+
</div>
|
|
226
|
+
<div className="search-panel__entry__content__item__actions">
|
|
227
|
+
<button
|
|
228
|
+
className="search-panel__entry__content__item__action"
|
|
229
|
+
tabIndex={-1}
|
|
230
|
+
title="Go to Result"
|
|
231
|
+
onClick={goToResult}
|
|
232
|
+
>
|
|
233
|
+
<ArrowCircleRightIcon />
|
|
234
|
+
</button>
|
|
235
|
+
</div>
|
|
236
|
+
</div>
|
|
237
|
+
);
|
|
238
|
+
},
|
|
239
|
+
);
|
|
240
|
+
|
|
241
|
+
const CandidateWithPackageNotImportedDisplay = observer(
|
|
242
|
+
(props: { candidate: CandidateWithPackageNotImported }) => {
|
|
243
|
+
const { candidate } = props;
|
|
244
|
+
const editorStore = useEditorStore();
|
|
245
|
+
const applicationStore = useApplicationStore();
|
|
246
|
+
const goToResult = (): void => {
|
|
247
|
+
flowResult(
|
|
248
|
+
editorStore.loadFile(
|
|
249
|
+
candidate.sourceID,
|
|
250
|
+
new FileCoordinate(
|
|
251
|
+
candidate.sourceID,
|
|
252
|
+
candidate.line,
|
|
253
|
+
candidate.column,
|
|
254
|
+
),
|
|
255
|
+
),
|
|
256
|
+
).catch(applicationStore.alertUnhandledError);
|
|
257
|
+
};
|
|
258
|
+
const useCandidate = (): void => {
|
|
259
|
+
flowResult(
|
|
260
|
+
editorStore.updateFileUsingSuggestionCandidate(candidate),
|
|
261
|
+
).catch(applicationStore.alertUnhandledError);
|
|
262
|
+
};
|
|
263
|
+
|
|
264
|
+
return (
|
|
265
|
+
<div className="search-panel__entry__content__item">
|
|
266
|
+
<div
|
|
267
|
+
className="search-panel__entry__content__item__label__candidate"
|
|
268
|
+
title="Add Suggested Import"
|
|
269
|
+
onClick={useCandidate}
|
|
270
|
+
>
|
|
271
|
+
<div className="search-panel__entry__content__item__label__candidate-name">
|
|
272
|
+
{candidate.foundName}
|
|
273
|
+
</div>
|
|
274
|
+
<div className="search-panel__entry__content__item__label__candidate-location">
|
|
275
|
+
{`${trimPathLeadingSlash(candidate.sourceID)} [${candidate.line}:${
|
|
276
|
+
candidate.column
|
|
277
|
+
}]`}
|
|
278
|
+
</div>
|
|
279
|
+
</div>
|
|
280
|
+
<div className="search-panel__entry__content__item__actions">
|
|
281
|
+
<button
|
|
282
|
+
className="search-panel__entry__content__item__action"
|
|
283
|
+
tabIndex={-1}
|
|
284
|
+
title="Go to Result"
|
|
285
|
+
onClick={goToResult}
|
|
286
|
+
>
|
|
287
|
+
<ArrowCircleRightIcon />
|
|
288
|
+
</button>
|
|
289
|
+
</div>
|
|
290
|
+
</div>
|
|
291
|
+
);
|
|
292
|
+
},
|
|
293
|
+
);
|
|
294
|
+
|
|
295
|
+
const UnmatchedFunctionExecutionResultDisplay = observer(
|
|
296
|
+
(props: { searchState: UnmatchedFunctionExecutionResultState }) => {
|
|
297
|
+
const { searchState } = props;
|
|
298
|
+
const result = searchState.result;
|
|
299
|
+
|
|
300
|
+
return (
|
|
301
|
+
<div className="search-panel__content">
|
|
302
|
+
{!result.candidatesWithPackageImported.length && (
|
|
303
|
+
<div className="search-panel__content__header">{`No functions, in packages already imported, match the function '${result.candidateName}'`}</div>
|
|
304
|
+
)}
|
|
305
|
+
{Boolean(result.candidatesWithPackageImported.length) && (
|
|
306
|
+
<>
|
|
307
|
+
<div className="search-panel__content__header">
|
|
308
|
+
{`These functions, in packages already imported, would match the function '${result.candidateName}' if you changed the parameters`}
|
|
309
|
+
</div>
|
|
310
|
+
<div className="search-panel__entry">
|
|
311
|
+
{result.candidatesWithPackageImported.map((candidate) => (
|
|
312
|
+
<CandidateWithPackageImportedDisplay
|
|
313
|
+
key={candidate.uuid}
|
|
314
|
+
candidate={candidate}
|
|
315
|
+
/>
|
|
316
|
+
))}
|
|
317
|
+
</div>
|
|
318
|
+
</>
|
|
319
|
+
)}
|
|
320
|
+
{!result.candidatesWithPackageNotImported.length && (
|
|
321
|
+
<div className="search-panel__content__header">{`No functions, in packages not imported, match the function '${result.candidateName}'`}</div>
|
|
322
|
+
)}
|
|
323
|
+
{Boolean(result.candidatesWithPackageNotImported.length) && (
|
|
324
|
+
<>
|
|
325
|
+
<div className="search-panel__content__header">
|
|
326
|
+
{`These functions, in packages not imported, match the function '${result.candidateName}'. Click on result to import the necessary package`}
|
|
327
|
+
</div>
|
|
328
|
+
<div className="search-panel__entry">
|
|
329
|
+
{result.candidatesWithPackageNotImported.map((candidate) => (
|
|
330
|
+
<CandidateWithPackageNotImportedDisplay
|
|
331
|
+
key={candidate.uuid}
|
|
332
|
+
candidate={candidate}
|
|
333
|
+
/>
|
|
334
|
+
))}
|
|
335
|
+
</div>
|
|
336
|
+
</>
|
|
337
|
+
)}
|
|
338
|
+
</div>
|
|
339
|
+
);
|
|
340
|
+
},
|
|
341
|
+
);
|
|
342
|
+
|
|
343
|
+
const UnmatchExecutionResultDisplay = observer(
|
|
344
|
+
(props: { searchState: UnmatchExecutionResultState }) => {
|
|
345
|
+
const { searchState } = props;
|
|
346
|
+
const result = searchState.result;
|
|
347
|
+
|
|
348
|
+
return (
|
|
349
|
+
<div className="search-panel__content">
|
|
350
|
+
{!result.candidates.length && (
|
|
351
|
+
<div className="search-panel__content__header">{`No possible matches found for '${result.candidateName}'`}</div>
|
|
352
|
+
)}
|
|
353
|
+
{Boolean(result.candidates.length) && (
|
|
354
|
+
<>
|
|
355
|
+
<div className="search-panel__content__header">
|
|
356
|
+
{`Found possible matches for '${result.candidateName}'. Click on result to import the necessary package`}
|
|
357
|
+
</div>
|
|
358
|
+
<div className="search-panel__entry">
|
|
359
|
+
{result.candidates.map((candidate) => (
|
|
360
|
+
<CandidateWithPackageNotImportedDisplay
|
|
361
|
+
key={candidate.uuid}
|
|
362
|
+
candidate={candidate}
|
|
363
|
+
/>
|
|
364
|
+
))}
|
|
365
|
+
</div>
|
|
366
|
+
</>
|
|
367
|
+
)}
|
|
368
|
+
</div>
|
|
369
|
+
);
|
|
370
|
+
},
|
|
371
|
+
);
|
|
372
|
+
|
|
373
|
+
export const SearchPanel = observer(() => {
|
|
374
|
+
const editorStore = useEditorStore();
|
|
375
|
+
return (
|
|
376
|
+
<div className="search-panel">
|
|
377
|
+
<PanelLoadingIndicator
|
|
378
|
+
isLoading={editorStore.textSearchCommandLoadingState.isInProgress}
|
|
379
|
+
/>
|
|
380
|
+
{!editorStore.searchState && (
|
|
381
|
+
<BlankPanelContent>
|
|
382
|
+
<div className="auxiliary-panel__splash-screen">
|
|
383
|
+
<div className="auxiliary-panel__splash-screen__content">
|
|
384
|
+
<div className="auxiliary-panel__splash-screen__content__item">
|
|
385
|
+
<div className="auxiliary-panel__splash-screen__content__item__label">
|
|
386
|
+
Search something
|
|
387
|
+
</div>
|
|
388
|
+
<div className="auxiliary-panel__splash-screen__content__item__hot-keys">
|
|
389
|
+
<div className="hotkey__key">Ctrl</div>
|
|
390
|
+
<div className="hotkey__plus">
|
|
391
|
+
<PlusIcon />
|
|
392
|
+
</div>
|
|
393
|
+
<div className="hotkey__key">Shift</div>
|
|
394
|
+
<div className="hotkey__plus">
|
|
395
|
+
<PlusIcon />
|
|
396
|
+
</div>
|
|
397
|
+
<div className="hotkey__key">F</div>
|
|
398
|
+
</div>
|
|
399
|
+
</div>
|
|
400
|
+
</div>
|
|
401
|
+
</div>
|
|
402
|
+
</BlankPanelContent>
|
|
403
|
+
)}
|
|
404
|
+
{editorStore.searchState instanceof UsageResultState && (
|
|
405
|
+
<UsageResultDisplay usageState={editorStore.searchState} />
|
|
406
|
+
)}
|
|
407
|
+
{editorStore.searchState instanceof SearchResultState && (
|
|
408
|
+
<SearchResultDisplay searchState={editorStore.searchState} />
|
|
409
|
+
)}
|
|
410
|
+
{editorStore.searchState instanceof
|
|
411
|
+
UnmatchedFunctionExecutionResultState && (
|
|
412
|
+
<UnmatchedFunctionExecutionResultDisplay
|
|
413
|
+
searchState={editorStore.searchState}
|
|
414
|
+
/>
|
|
415
|
+
)}
|
|
416
|
+
{editorStore.searchState instanceof UnmatchExecutionResultState && (
|
|
417
|
+
<UnmatchExecutionResultDisplay searchState={editorStore.searchState} />
|
|
418
|
+
)}
|
|
419
|
+
</div>
|
|
420
|
+
);
|
|
421
|
+
});
|