@nimblesite/lsp-profiler-ui 0.0.0-stage → 0.3.0
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 +21 -0
- package/out/src/bind-host.d.ts +3 -0
- package/out/src/bind-host.js +52 -0
- package/out/src/bind-host.js.map +1 -0
- package/out/src/context-keys.d.ts +4 -0
- package/out/src/context-keys.js +54 -0
- package/out/src/context-keys.js.map +1 -0
- package/out/src/dap-evaluate.d.ts +84 -0
- package/out/src/dap-evaluate.js +442 -0
- package/out/src/dap-evaluate.js.map +1 -0
- package/out/src/dap-output.d.ts +50 -0
- package/out/src/dap-output.js +177 -0
- package/out/src/dap-output.js.map +1 -0
- package/out/src/debug/adapter-resolution.d.ts +56 -0
- package/out/src/debug/adapter-resolution.js +112 -0
- package/out/src/debug/adapter-resolution.js.map +1 -0
- package/out/src/debug/dap-messages.d.ts +18 -0
- package/out/src/debug/dap-messages.js +71 -0
- package/out/src/debug/dap-messages.js.map +1 -0
- package/out/src/debug/index.d.ts +7 -0
- package/out/src/debug/index.js +27 -0
- package/out/src/debug/index.js.map +1 -0
- package/out/src/debug/launch-config.d.ts +42 -0
- package/out/src/debug/launch-config.js +73 -0
- package/out/src/debug/launch-config.js.map +1 -0
- package/out/src/debug/launch-lifecycle.d.ts +29 -0
- package/out/src/debug/launch-lifecycle.js +40 -0
- package/out/src/debug/launch-lifecycle.js.map +1 -0
- package/out/src/debug/poll.d.ts +25 -0
- package/out/src/debug/poll.js +70 -0
- package/out/src/debug/poll.js.map +1 -0
- package/out/src/debug/profiling.d.ts +34 -0
- package/out/src/debug/profiling.js +81 -0
- package/out/src/debug/profiling.js.map +1 -0
- package/out/src/debug/testing/assertions.d.ts +27 -0
- package/out/src/debug/testing/assertions.js +111 -0
- package/out/src/debug/testing/assertions.js.map +1 -0
- package/out/src/debug/testing/dap-client.d.ts +86 -0
- package/out/src/debug/testing/dap-client.js +204 -0
- package/out/src/debug/testing/dap-client.js.map +1 -0
- package/out/src/debug/testing/index.d.ts +7 -0
- package/out/src/debug/testing/index.js +31 -0
- package/out/src/debug/testing/index.js.map +1 -0
- package/out/src/debug/testing/vscode-harness.d.ts +44 -0
- package/out/src/debug/testing/vscode-harness.js +81 -0
- package/out/src/debug/testing/vscode-harness.js.map +1 -0
- package/out/src/debug/ui-stubs.d.ts +26 -0
- package/out/src/debug/ui-stubs.js +88 -0
- package/out/src/debug/ui-stubs.js.map +1 -0
- package/out/src/debug-link-setup.d.ts +4 -0
- package/out/src/debug-link-setup.js +19 -0
- package/out/src/debug-link-setup.js.map +1 -0
- package/out/src/debug-link-view.d.ts +4 -0
- package/out/src/debug-link-view.js +49 -0
- package/out/src/debug-link-view.js.map +1 -0
- package/out/src/debug-link.d.ts +6 -0
- package/out/src/debug-link.js +95 -0
- package/out/src/debug-link.js.map +1 -0
- package/out/src/debug-selection.d.ts +14 -0
- package/out/src/debug-selection.js +33 -0
- package/out/src/debug-selection.js.map +1 -0
- package/out/src/debuggee-pause.d.ts +11 -0
- package/out/src/debuggee-pause.js +109 -0
- package/out/src/debuggee-pause.js.map +1 -0
- package/out/src/editor-path-key.d.ts +52 -0
- package/out/src/editor-path-key.js +105 -0
- package/out/src/editor-path-key.js.map +1 -0
- package/out/src/failure.d.ts +5 -0
- package/out/src/failure.js +53 -0
- package/out/src/failure.js.map +1 -0
- package/out/src/file-log-sink.d.ts +20 -0
- package/out/src/file-log-sink.js +74 -0
- package/out/src/file-log-sink.js.map +1 -0
- package/out/src/flame-html.d.ts +8 -0
- package/out/src/flame-html.js +104 -0
- package/out/src/flame-html.js.map +1 -0
- package/out/src/flame-model.d.ts +93 -0
- package/out/src/flame-model.js +242 -0
- package/out/src/flame-model.js.map +1 -0
- package/out/src/flame-script-helpers.d.ts +26 -0
- package/out/src/flame-script-helpers.js +71 -0
- package/out/src/flame-script-helpers.js.map +1 -0
- package/out/src/flame-script.d.ts +1 -0
- package/out/src/flame-script.js +332 -0
- package/out/src/flame-script.js.map +1 -0
- package/out/src/flame-time-order.d.ts +14 -0
- package/out/src/flame-time-order.js +112 -0
- package/out/src/flame-time-order.js.map +1 -0
- package/out/src/flamegraph-artifact.d.ts +9 -0
- package/out/src/flamegraph-artifact.js +45 -0
- package/out/src/flamegraph-artifact.js.map +1 -0
- package/out/src/host.d.ts +31 -0
- package/out/src/host.js +6 -0
- package/out/src/host.js.map +1 -0
- package/out/src/ids.d.ts +27 -0
- package/out/src/ids.js +63 -0
- package/out/src/ids.js.map +1 -0
- package/out/src/index.d.ts +42 -0
- package/out/src/index.js +98 -0
- package/out/src/index.js.map +1 -0
- package/out/src/logger.d.ts +50 -0
- package/out/src/logger.js +86 -0
- package/out/src/logger.js.map +1 -0
- package/out/src/memory-autopilot.d.ts +64 -0
- package/out/src/memory-autopilot.js +306 -0
- package/out/src/memory-autopilot.js.map +1 -0
- package/out/src/memory-capture-ids.d.ts +17 -0
- package/out/src/memory-capture-ids.js +45 -0
- package/out/src/memory-capture-ids.js.map +1 -0
- package/out/src/memory-capture-ingest.d.ts +15 -0
- package/out/src/memory-capture-ingest.js +84 -0
- package/out/src/memory-capture-ingest.js.map +1 -0
- package/out/src/memory-capture-legs.d.ts +4 -0
- package/out/src/memory-capture-legs.js +55 -0
- package/out/src/memory-capture-legs.js.map +1 -0
- package/out/src/memory-capture-present.d.ts +32 -0
- package/out/src/memory-capture-present.js +71 -0
- package/out/src/memory-capture-present.js.map +1 -0
- package/out/src/memory-capture-roundtrip.d.ts +17 -0
- package/out/src/memory-capture-roundtrip.js +75 -0
- package/out/src/memory-capture-roundtrip.js.map +1 -0
- package/out/src/memory-capture-state.d.ts +23 -0
- package/out/src/memory-capture-state.js +89 -0
- package/out/src/memory-capture-state.js.map +1 -0
- package/out/src/memory-capture-types.d.ts +28 -0
- package/out/src/memory-capture-types.js +70 -0
- package/out/src/memory-capture-types.js.map +1 -0
- package/out/src/memory-capture.d.ts +24 -0
- package/out/src/memory-capture.js +51 -0
- package/out/src/memory-capture.js.map +1 -0
- package/out/src/memory-dashboard-html.d.ts +3 -0
- package/out/src/memory-dashboard-html.js +327 -0
- package/out/src/memory-dashboard-html.js.map +1 -0
- package/out/src/memory-dashboard-mapping.d.ts +34 -0
- package/out/src/memory-dashboard-mapping.js +135 -0
- package/out/src/memory-dashboard-mapping.js.map +1 -0
- package/out/src/memory-dashboard.d.ts +82 -0
- package/out/src/memory-dashboard.js +142 -0
- package/out/src/memory-dashboard.js.map +1 -0
- package/out/src/memory-decorations.d.ts +61 -0
- package/out/src/memory-decorations.js +247 -0
- package/out/src/memory-decorations.js.map +1 -0
- package/out/src/memory-finalize.d.ts +25 -0
- package/out/src/memory-finalize.js +207 -0
- package/out/src/memory-finalize.js.map +1 -0
- package/out/src/memory-guidance.d.ts +14 -0
- package/out/src/memory-guidance.js +36 -0
- package/out/src/memory-guidance.js.map +1 -0
- package/out/src/memory-inspect-commands.d.ts +20 -0
- package/out/src/memory-inspect-commands.js +114 -0
- package/out/src/memory-inspect-commands.js.map +1 -0
- package/out/src/memory-launch-direct.d.ts +12 -0
- package/out/src/memory-launch-direct.js +74 -0
- package/out/src/memory-launch-direct.js.map +1 -0
- package/out/src/memory-launch.d.ts +4 -0
- package/out/src/memory-launch.js +92 -0
- package/out/src/memory-launch.js.map +1 -0
- package/out/src/memory-leak-offer.d.ts +18 -0
- package/out/src/memory-leak-offer.js +51 -0
- package/out/src/memory-leak-offer.js.map +1 -0
- package/out/src/memory-profiler.d.ts +27 -0
- package/out/src/memory-profiler.js +71 -0
- package/out/src/memory-profiler.js.map +1 -0
- package/out/src/memory-ref-graph.d.ts +62 -0
- package/out/src/memory-ref-graph.js +248 -0
- package/out/src/memory-ref-graph.js.map +1 -0
- package/out/src/memory-ref-picker.d.ts +21 -0
- package/out/src/memory-ref-picker.js +103 -0
- package/out/src/memory-ref-picker.js.map +1 -0
- package/out/src/memory-registration.d.ts +4 -0
- package/out/src/memory-registration.js +63 -0
- package/out/src/memory-registration.js.map +1 -0
- package/out/src/memory-start-core.d.ts +8 -0
- package/out/src/memory-start-core.js +165 -0
- package/out/src/memory-start-core.js.map +1 -0
- package/out/src/memory-start-stop-commands.d.ts +10 -0
- package/out/src/memory-start-stop-commands.js +75 -0
- package/out/src/memory-start-stop-commands.js.map +1 -0
- package/out/src/memory-start.d.ts +6 -0
- package/out/src/memory-start.js +13 -0
- package/out/src/memory-start.js.map +1 -0
- package/out/src/memory-status.d.ts +24 -0
- package/out/src/memory-status.js +135 -0
- package/out/src/memory-status.js.map +1 -0
- package/out/src/palette-vscode.d.ts +2 -0
- package/out/src/palette-vscode.js +50 -0
- package/out/src/palette-vscode.js.map +1 -0
- package/out/src/palette.d.ts +70 -0
- package/out/src/palette.js +150 -0
- package/out/src/palette.js.map +1 -0
- package/out/src/process-bind-panel.d.ts +11 -0
- package/out/src/process-bind-panel.js +65 -0
- package/out/src/process-bind-panel.js.map +1 -0
- package/out/src/process-commands.d.ts +5 -0
- package/out/src/process-commands.js +112 -0
- package/out/src/process-commands.js.map +1 -0
- package/out/src/process-context-keys.d.ts +11 -0
- package/out/src/process-context-keys.js +48 -0
- package/out/src/process-context-keys.js.map +1 -0
- package/out/src/process-decoration.d.ts +18 -0
- package/out/src/process-decoration.js +76 -0
- package/out/src/process-decoration.js.map +1 -0
- package/out/src/process-explorer-rows.d.ts +59 -0
- package/out/src/process-explorer-rows.js +47 -0
- package/out/src/process-explorer-rows.js.map +1 -0
- package/out/src/process-explorer.d.ts +66 -0
- package/out/src/process-explorer.js +241 -0
- package/out/src/process-explorer.js.map +1 -0
- package/out/src/process-group-item.d.ts +8 -0
- package/out/src/process-group-item.js +55 -0
- package/out/src/process-group-item.js.map +1 -0
- package/out/src/process-launch-item.d.ts +12 -0
- package/out/src/process-launch-item.js +57 -0
- package/out/src/process-launch-item.js.map +1 -0
- package/out/src/process-launch.d.ts +47 -0
- package/out/src/process-launch.js +205 -0
- package/out/src/process-launch.js.map +1 -0
- package/out/src/process-message-item.d.ts +10 -0
- package/out/src/process-message-item.js +53 -0
- package/out/src/process-message-item.js.map +1 -0
- package/out/src/process-poll.d.ts +26 -0
- package/out/src/process-poll.js +125 -0
- package/out/src/process-poll.js.map +1 -0
- package/out/src/process-reactivity.d.ts +55 -0
- package/out/src/process-reactivity.js +188 -0
- package/out/src/process-reactivity.js.map +1 -0
- package/out/src/process-registration.d.ts +11 -0
- package/out/src/process-registration.js +55 -0
- package/out/src/process-registration.js.map +1 -0
- package/out/src/process-tree-item.d.ts +18 -0
- package/out/src/process-tree-item.js +219 -0
- package/out/src/process-tree-item.js.map +1 -0
- package/out/src/processes-state.d.ts +75 -0
- package/out/src/processes-state.js +76 -0
- package/out/src/processes-state.js.map +1 -0
- package/out/src/profile-on-launch.d.ts +4 -0
- package/out/src/profile-on-launch.js +16 -0
- package/out/src/profile-on-launch.js.map +1 -0
- package/out/src/profile-server.d.ts +24 -0
- package/out/src/profile-server.js +170 -0
- package/out/src/profile-server.js.map +1 -0
- package/out/src/profiler-attach.d.ts +19 -0
- package/out/src/profiler-attach.js +129 -0
- package/out/src/profiler-attach.js.map +1 -0
- package/out/src/profiler-commands.d.ts +8 -0
- package/out/src/profiler-commands.js +110 -0
- package/out/src/profiler-commands.js.map +1 -0
- package/out/src/profiler-decorations.d.ts +74 -0
- package/out/src/profiler-decorations.js +237 -0
- package/out/src/profiler-decorations.js.map +1 -0
- package/out/src/profiler-dispose.d.ts +6 -0
- package/out/src/profiler-dispose.js +20 -0
- package/out/src/profiler-dispose.js.map +1 -0
- package/out/src/profiler-flamegraph-html.d.ts +61 -0
- package/out/src/profiler-flamegraph-html.js +366 -0
- package/out/src/profiler-flamegraph-html.js.map +1 -0
- package/out/src/profiler-format.d.ts +10 -0
- package/out/src/profiler-format.js +28 -0
- package/out/src/profiler-format.js.map +1 -0
- package/out/src/profiler-launch-cooperative.d.ts +16 -0
- package/out/src/profiler-launch-cooperative.js +167 -0
- package/out/src/profiler-launch-cooperative.js.map +1 -0
- package/out/src/profiler-launch.d.ts +29 -0
- package/out/src/profiler-launch.js +123 -0
- package/out/src/profiler-launch.js.map +1 -0
- package/out/src/profiler-results.d.ts +22 -0
- package/out/src/profiler-results.js +104 -0
- package/out/src/profiler-results.js.map +1 -0
- package/out/src/profiler-session-core.d.ts +42 -0
- package/out/src/profiler-session-core.js +116 -0
- package/out/src/profiler-session-core.js.map +1 -0
- package/out/src/profiler-state.d.ts +87 -0
- package/out/src/profiler-state.js +83 -0
- package/out/src/profiler-state.js.map +1 -0
- package/out/src/profiler-status.d.ts +38 -0
- package/out/src/profiler-status.js +163 -0
- package/out/src/profiler-status.js.map +1 -0
- package/out/src/profiler-styles.d.ts +21 -0
- package/out/src/profiler-styles.js +160 -0
- package/out/src/profiler-styles.js.map +1 -0
- package/out/src/profiler-webview.d.ts +95 -0
- package/out/src/profiler-webview.js +243 -0
- package/out/src/profiler-webview.js.map +1 -0
- package/out/src/profiler.d.ts +23 -0
- package/out/src/profiler.js +113 -0
- package/out/src/profiler.js.map +1 -0
- package/out/src/progress-ops.d.ts +24 -0
- package/out/src/progress-ops.js +135 -0
- package/out/src/progress-ops.js.map +1 -0
- package/out/src/reactive-refresh.d.ts +24 -0
- package/out/src/reactive-refresh.js +33 -0
- package/out/src/reactive-refresh.js.map +1 -0
- package/out/src/sample-summary.d.ts +39 -0
- package/out/src/sample-summary.js +32 -0
- package/out/src/sample-summary.js.map +1 -0
- package/out/src/sampled-view.d.ts +15 -0
- package/out/src/sampled-view.js +56 -0
- package/out/src/sampled-view.js.map +1 -0
- package/out/src/server-command.d.ts +4 -0
- package/out/src/server-command.js +14 -0
- package/out/src/server-command.js.map +1 -0
- package/out/src/settings.d.ts +1 -0
- package/out/src/settings.js +22 -0
- package/out/src/settings.js.map +1 -0
- package/out/src/store.d.ts +34 -0
- package/out/src/store.js +64 -0
- package/out/src/store.js.map +1 -0
- package/out/src/testing/cpu-capture-assertions.d.ts +8 -0
- package/out/src/testing/cpu-capture-assertions.js +71 -0
- package/out/src/testing/cpu-capture-assertions.js.map +1 -0
- package/out/src/testing/cpu-capture-contract.d.ts +8 -0
- package/out/src/testing/cpu-capture-contract.js +123 -0
- package/out/src/testing/cpu-capture-contract.js.map +1 -0
- package/out/src/testing/webview-contract-helpers.d.ts +24 -0
- package/out/src/testing/webview-contract-helpers.js +125 -0
- package/out/src/testing/webview-contract-helpers.js.map +1 -0
- package/out/src/testing/webview-contract-leak.d.ts +2 -0
- package/out/src/testing/webview-contract-leak.js +80 -0
- package/out/src/testing/webview-contract-leak.js.map +1 -0
- package/out/src/testing/webview-contract-memory.d.ts +5 -0
- package/out/src/testing/webview-contract-memory.js +221 -0
- package/out/src/testing/webview-contract-memory.js.map +1 -0
- package/out/src/testing/webview-contract-palette.d.ts +6 -0
- package/out/src/testing/webview-contract-palette.js +121 -0
- package/out/src/testing/webview-contract-palette.js.map +1 -0
- package/out/src/testing/webview-contract-panel.d.ts +7 -0
- package/out/src/testing/webview-contract-panel.js +100 -0
- package/out/src/testing/webview-contract-panel.js.map +1 -0
- package/out/src/testing/webview-contract-results.d.ts +6 -0
- package/out/src/testing/webview-contract-results.js +136 -0
- package/out/src/testing/webview-contract-results.js.map +1 -0
- package/out/src/testing/webview-contract.d.ts +18 -0
- package/out/src/testing/webview-contract.js +23 -0
- package/out/src/testing/webview-contract.js.map +1 -0
- package/out/src/timeouts.d.ts +21 -0
- package/out/src/timeouts.js +30 -0
- package/out/src/timeouts.js.map +1 -0
- package/out/src/trace-actions.d.ts +33 -0
- package/out/src/trace-actions.js +135 -0
- package/out/src/trace-actions.js.map +1 -0
- package/out/src/unknown-shape.d.ts +58 -0
- package/out/src/unknown-shape.js +110 -0
- package/out/src/unknown-shape.js.map +1 -0
- package/out/src/wire-adapters.d.ts +18 -0
- package/out/src/wire-adapters.js +160 -0
- package/out/src/wire-adapters.js.map +1 -0
- package/out/src/wire-generated.d.ts +760 -0
- package/out/src/wire-generated.js +38 -0
- package/out/src/wire-generated.js.map +1 -0
- package/package.json +53 -4
- package/scripts/contributions.mjs +187 -0
- package/README.md +0 -3
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes panel — row presentation layer.
|
|
3
|
+
*
|
|
4
|
+
* Everything about how a process renders as a tree row lives here: the process
|
|
5
|
+
* model, sort/group mode tables, and the tree-item classes. The item classes
|
|
6
|
+
* are split into sibling modules (one class per file) and re-exported here so
|
|
7
|
+
* the provider keeps one import site.
|
|
8
|
+
*/
|
|
9
|
+
import type { LaunchActionItem } from "./process-launch-item";
|
|
10
|
+
import type { MessageTreeItem } from "./process-message-item";
|
|
11
|
+
import type { ProcessGroupItem } from "./process-group-item";
|
|
12
|
+
import type { ProcessTreeItem } from "./process-tree-item";
|
|
13
|
+
export { LaunchActionItem } from "./process-launch-item";
|
|
14
|
+
export { MessageTreeItem } from "./process-message-item";
|
|
15
|
+
export { ProcessGroupItem } from "./process-group-item";
|
|
16
|
+
export { ProcessTreeItem } from "./process-tree-item";
|
|
17
|
+
/** What the server advertises about a row's runtime ([PROF-UI-CAPABILITIES]). */
|
|
18
|
+
export interface RowRuntime {
|
|
19
|
+
/** The runtime reads its own heap, so any attachable process can be memory-tracked. */
|
|
20
|
+
readonly directMemory: boolean;
|
|
21
|
+
/** The runtime's advertised `display_name`; the wire id when the server named none. */
|
|
22
|
+
readonly name: string;
|
|
23
|
+
/** The process's entry is a source file the editor can open (never a binary). */
|
|
24
|
+
readonly sourceEntries: boolean;
|
|
25
|
+
/** False when the runtime has no memory backend: the row then offers and suggests no memory tracking. */
|
|
26
|
+
readonly memory?: boolean;
|
|
27
|
+
}
|
|
28
|
+
/** One recognised process; the view model of the wire `ProcessInfo` ([PROF-PROCESSES]). */
|
|
29
|
+
export interface ProcessInfo {
|
|
30
|
+
readonly pid: number;
|
|
31
|
+
readonly ppid: number;
|
|
32
|
+
readonly name: string;
|
|
33
|
+
readonly interpreterPath: string | null;
|
|
34
|
+
readonly script: string | null;
|
|
35
|
+
readonly runtime: string;
|
|
36
|
+
readonly runtimeVersion: string | null;
|
|
37
|
+
readonly cpuPercent: number;
|
|
38
|
+
readonly memoryBytes: number;
|
|
39
|
+
readonly runtimeSecs: number;
|
|
40
|
+
readonly user: string | null;
|
|
41
|
+
readonly requiresElevation: boolean;
|
|
42
|
+
/** `true` when the process belongs to an open workspace root — renders green. */
|
|
43
|
+
readonly inWorkspace: boolean;
|
|
44
|
+
/** Framework name (`uvicorn`, …) when a known launcher, else `null` — chip. */
|
|
45
|
+
readonly launcher: string | null;
|
|
46
|
+
/** `false` when the profiler can't attach — renders 🚫, greyed, sorted last. */
|
|
47
|
+
readonly debuggable: boolean;
|
|
48
|
+
/** Tooltip reason shown when `debuggable` is `false`. */
|
|
49
|
+
readonly undebuggableReason: string | null;
|
|
50
|
+
}
|
|
51
|
+
export type SortMode = "cpu" | "memory" | "pid" | "name" | "runtime" | "version";
|
|
52
|
+
export declare const SORT_CYCLE: readonly SortMode[];
|
|
53
|
+
export declare const SORT_LABEL: Readonly<Record<SortMode, string>>;
|
|
54
|
+
/** Per-mode row comparators; `sortProcesses` wraps these to sink non-debuggable rows. */
|
|
55
|
+
export declare const SORT_COMPARATORS: Readonly<Record<SortMode, (left: ProcessInfo, right: ProcessInfo) => number>>;
|
|
56
|
+
export type GroupMode = "none" | "version" | "interpreter" | "user" | "parent";
|
|
57
|
+
export declare const GROUP_CYCLE: readonly GroupMode[];
|
|
58
|
+
export declare const GROUP_LABEL: Readonly<Record<GroupMode, string>>;
|
|
59
|
+
export type TreeItem = LaunchActionItem | ProcessGroupItem | ProcessTreeItem | MessageTreeItem;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
|
|
3
|
+
/**
|
|
4
|
+
* Processes panel — row presentation layer.
|
|
5
|
+
*
|
|
6
|
+
* Everything about how a process renders as a tree row lives here: the process
|
|
7
|
+
* model, sort/group mode tables, and the tree-item classes. The item classes
|
|
8
|
+
* are split into sibling modules (one class per file) and re-exported here so
|
|
9
|
+
* the provider keeps one import site.
|
|
10
|
+
*/
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.GROUP_LABEL = exports.GROUP_CYCLE = exports.SORT_COMPARATORS = exports.SORT_LABEL = exports.SORT_CYCLE = exports.ProcessTreeItem = exports.ProcessGroupItem = exports.MessageTreeItem = exports.LaunchActionItem = void 0;
|
|
13
|
+
var process_launch_item_1 = require("./process-launch-item");
|
|
14
|
+
Object.defineProperty(exports, "LaunchActionItem", { enumerable: true, get: function () { return process_launch_item_1.LaunchActionItem; } });
|
|
15
|
+
var process_message_item_1 = require("./process-message-item");
|
|
16
|
+
Object.defineProperty(exports, "MessageTreeItem", { enumerable: true, get: function () { return process_message_item_1.MessageTreeItem; } });
|
|
17
|
+
var process_group_item_1 = require("./process-group-item");
|
|
18
|
+
Object.defineProperty(exports, "ProcessGroupItem", { enumerable: true, get: function () { return process_group_item_1.ProcessGroupItem; } });
|
|
19
|
+
var process_tree_item_1 = require("./process-tree-item");
|
|
20
|
+
Object.defineProperty(exports, "ProcessTreeItem", { enumerable: true, get: function () { return process_tree_item_1.ProcessTreeItem; } });
|
|
21
|
+
exports.SORT_CYCLE = ["cpu", "memory", "pid", "name", "runtime", "version"];
|
|
22
|
+
exports.SORT_LABEL = {
|
|
23
|
+
cpu: "CPU %",
|
|
24
|
+
memory: "Memory",
|
|
25
|
+
pid: "PID",
|
|
26
|
+
name: "Name",
|
|
27
|
+
runtime: "Runtime",
|
|
28
|
+
version: "Runtime version",
|
|
29
|
+
};
|
|
30
|
+
/** Per-mode row comparators; `sortProcesses` wraps these to sink non-debuggable rows. */
|
|
31
|
+
exports.SORT_COMPARATORS = {
|
|
32
|
+
cpu: (left, right) => right.cpuPercent - left.cpuPercent,
|
|
33
|
+
memory: (left, right) => right.memoryBytes - left.memoryBytes,
|
|
34
|
+
pid: (left, right) => left.pid - right.pid,
|
|
35
|
+
name: (left, right) => left.name.localeCompare(right.name),
|
|
36
|
+
runtime: (left, right) => right.runtimeSecs - left.runtimeSecs,
|
|
37
|
+
version: (left, right) => (left.runtimeVersion ?? "").localeCompare(right.runtimeVersion ?? ""),
|
|
38
|
+
};
|
|
39
|
+
exports.GROUP_CYCLE = ["none", "version", "interpreter", "user", "parent"];
|
|
40
|
+
exports.GROUP_LABEL = {
|
|
41
|
+
none: "None",
|
|
42
|
+
version: "Runtime version",
|
|
43
|
+
interpreter: "Executable",
|
|
44
|
+
user: "User",
|
|
45
|
+
parent: "Parent process",
|
|
46
|
+
};
|
|
47
|
+
//# sourceMappingURL=process-explorer-rows.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-explorer-rows.js","sourceRoot":"","sources":["../../src/process-explorer-rows.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE;;;;;;;GAOG;;;AAOH,6DAAyD;AAAhD,uHAAA,gBAAgB,OAAA;AACzB,+DAAyD;AAAhD,uHAAA,eAAe,OAAA;AACxB,2DAAwD;AAA/C,sHAAA,gBAAgB,OAAA;AACzB,yDAAsD;AAA7C,oHAAA,eAAe,OAAA;AA4CX,QAAA,UAAU,GAAwB,CAAC,KAAK,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,SAAS,CAAC,CAAC;AAEzF,QAAA,UAAU,GAAuC;IAC5D,GAAG,EAAE,OAAO;IACZ,MAAM,EAAE,QAAQ;IAChB,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,SAAS;IAClB,OAAO,EAAE,iBAAiB;CAC3B,CAAC;AAEF,yFAAyF;AAC5E,QAAA,gBAAgB,GAAkF;IAC7G,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,UAAU,GAAG,IAAI,CAAC,UAAU;IACxD,MAAM,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW;IAC7D,GAAG,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,GAAG,GAAG,KAAK,CAAC,GAAG;IAC1C,IAAI,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC;IAC1D,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,WAAW,GAAG,IAAI,CAAC,WAAW;IAC9D,OAAO,EAAE,CAAC,IAAI,EAAE,KAAK,EAAE,EAAE,CAAC,CAAC,IAAI,CAAC,cAAc,IAAI,EAAE,CAAC,CAAC,aAAa,CAAC,KAAK,CAAC,cAAc,IAAI,EAAE,CAAC;CAChG,CAAC;AAIW,QAAA,WAAW,GAAyB,CAAC,MAAM,EAAE,SAAS,EAAE,aAAa,EAAE,MAAM,EAAE,QAAQ,CAAC,CAAC;AAEzF,QAAA,WAAW,GAAwC;IAC9D,IAAI,EAAE,MAAM;IACZ,OAAO,EAAE,iBAAiB;IAC1B,WAAW,EAAE,YAAY;IACzB,IAAI,EAAE,MAAM;IACZ,MAAM,EAAE,gBAAgB;CACzB,CAAC"}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Processes — TreeDataProvider for the host's sidebar.
|
|
3
|
+
*
|
|
4
|
+
* The headline fix for #62: instead of a raw PID input box, the user picks a
|
|
5
|
+
* running Python process from this panel and starts CPU/memory profiling with
|
|
6
|
+
* one click. The process list is owned by the LSP (`<prefix>.lspProfiler.processes`,
|
|
7
|
+
* implemented over `sysinfo`) and fetched into the store's `processes` Signal by
|
|
8
|
+
* the store-side poll (process-poll.ts). This provider is a pure projection of
|
|
9
|
+
* that centralised state (#148): it holds no data or timer of its own — it
|
|
10
|
+
* sorts, groups, filters, and renders whatever the store says, re-rendering on
|
|
11
|
+
* each `processesRevision` bump exactly like the Modules panel
|
|
12
|
+
* ([PROF-UI-STATE]).
|
|
13
|
+
*/
|
|
14
|
+
import * as vscode from "vscode";
|
|
15
|
+
import type { ProfilerStore as Store } from "./store";
|
|
16
|
+
import type { ProcessPanelState } from "./processes-state";
|
|
17
|
+
import type { TreeItem } from "./process-explorer-rows";
|
|
18
|
+
export { type ProcessInfo } from "./process-explorer-rows";
|
|
19
|
+
export { type ProcessesFetchState as ProcessesState } from "./processes-state";
|
|
20
|
+
export { ProcessDecorationProvider } from "./process-decoration";
|
|
21
|
+
export declare class ProcessesProvider implements vscode.TreeDataProvider<TreeItem>, vscode.Disposable {
|
|
22
|
+
private readonly emitter;
|
|
23
|
+
readonly onDidChangeTreeData: vscode.Event<TreeItem | undefined>;
|
|
24
|
+
readonly disposables: vscode.Disposable[];
|
|
25
|
+
private readonly store;
|
|
26
|
+
constructor(store: Store);
|
|
27
|
+
/** Repaint from the store's current state (no fetch — pure projection, #148). */
|
|
28
|
+
refresh(): void;
|
|
29
|
+
/**
|
|
30
|
+
* The current process-fetch state — the e2e seam for [PROF-UI-PROCESSES]
|
|
31
|
+
* empty-state honesty (#147), mirrored to the `<prefix>.profiler.processesState` key.
|
|
32
|
+
*/
|
|
33
|
+
get processesState(): ProcessPanelState["fetch"];
|
|
34
|
+
/**
|
|
35
|
+
* Fetch fresh process data into the store — awaitable, so the manual Refresh
|
|
36
|
+
* command can run it under the view's progress bar ([PROF-UI-STATE]).
|
|
37
|
+
* The resulting revision bump repaints every subscribed view; the silent
|
|
38
|
+
* store-side poll needs no progress bar (a flash every tick would be noise).
|
|
39
|
+
*/
|
|
40
|
+
refreshNow(): Promise<void>;
|
|
41
|
+
cycleSortMode(): void;
|
|
42
|
+
cycleGroupMode(): void;
|
|
43
|
+
setFilter(text: string): void;
|
|
44
|
+
dispose(): void;
|
|
45
|
+
getTreeItem(element: TreeItem): vscode.TreeItem;
|
|
46
|
+
getChildren(element?: TreeItem): TreeItem[];
|
|
47
|
+
/**
|
|
48
|
+
* Processes exist, so the welcome can't show: the current-file launches are
|
|
49
|
+
* pinned to the top as rows ([PROF-UI-PROCESSES]), then the processes.
|
|
50
|
+
*/
|
|
51
|
+
private topLevelRows;
|
|
52
|
+
/**
|
|
53
|
+
* Render one process row. The "this row is being profiled" marker derives
|
|
54
|
+
* straight from the store's profiler signal — never a provider field (#148) —
|
|
55
|
+
* and the active-debuggee marker from the centralised panel state.
|
|
56
|
+
*/
|
|
57
|
+
private processRow;
|
|
58
|
+
/**
|
|
59
|
+
* The pinned current-file launch rows, gated per-activity: the CPU launch is
|
|
60
|
+
* hidden while CPU profiling is busy, the memory launch while memory tracking
|
|
61
|
+
* is busy — so a second same-metric run is never offered, yet either can start
|
|
62
|
+
* while the other runs ([PROF-UI-PROCESSES]). A server none of whose runtimes
|
|
63
|
+
* tracks memory never gets the memory launch ([PROF-UI-CAPABILITIES]).
|
|
64
|
+
*/
|
|
65
|
+
private launchActionRows;
|
|
66
|
+
}
|
|
@@ -0,0 +1,241 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
|
|
3
|
+
/**
|
|
4
|
+
* Processes — TreeDataProvider for the host's sidebar.
|
|
5
|
+
*
|
|
6
|
+
* The headline fix for #62: instead of a raw PID input box, the user picks a
|
|
7
|
+
* running Python process from this panel and starts CPU/memory profiling with
|
|
8
|
+
* one click. The process list is owned by the LSP (`<prefix>.lspProfiler.processes`,
|
|
9
|
+
* implemented over `sysinfo`) and fetched into the store's `processes` Signal by
|
|
10
|
+
* the store-side poll (process-poll.ts). This provider is a pure projection of
|
|
11
|
+
* that centralised state (#148): it holds no data or timer of its own — it
|
|
12
|
+
* sorts, groups, filters, and renders whatever the store says, re-rendering on
|
|
13
|
+
* each `processesRevision` bump exactly like the Modules panel
|
|
14
|
+
* ([PROF-UI-STATE]).
|
|
15
|
+
*/
|
|
16
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
19
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
20
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
21
|
+
}
|
|
22
|
+
Object.defineProperty(o, k2, desc);
|
|
23
|
+
}) : (function(o, m, k, k2) {
|
|
24
|
+
if (k2 === undefined) k2 = k;
|
|
25
|
+
o[k2] = m[k];
|
|
26
|
+
}));
|
|
27
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
28
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
29
|
+
}) : function(o, v) {
|
|
30
|
+
o["default"] = v;
|
|
31
|
+
});
|
|
32
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
33
|
+
var ownKeys = function(o) {
|
|
34
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
35
|
+
var ar = [];
|
|
36
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
37
|
+
return ar;
|
|
38
|
+
};
|
|
39
|
+
return ownKeys(o);
|
|
40
|
+
};
|
|
41
|
+
return function (mod) {
|
|
42
|
+
if (mod && mod.__esModule) return mod;
|
|
43
|
+
var result = {};
|
|
44
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
45
|
+
__setModuleDefault(result, mod);
|
|
46
|
+
return result;
|
|
47
|
+
};
|
|
48
|
+
})();
|
|
49
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
50
|
+
exports.ProcessesProvider = exports.ProcessDecorationProvider = void 0;
|
|
51
|
+
const vscode = __importStar(require("vscode"));
|
|
52
|
+
const ids_1 = require("./ids");
|
|
53
|
+
const process_poll_1 = require("./process-poll");
|
|
54
|
+
const process_explorer_rows_1 = require("./process-explorer-rows");
|
|
55
|
+
var process_decoration_1 = require("./process-decoration");
|
|
56
|
+
Object.defineProperty(exports, "ProcessDecorationProvider", { enumerable: true, get: function () { return process_decoration_1.ProcessDecorationProvider; } });
|
|
57
|
+
/** How long the "sorted/grouped by …" status hint stays visible (ms). */
|
|
58
|
+
const STATUS_HINT_MS = 2000;
|
|
59
|
+
// ── Provider ─────────────────────────────────────────────────────────────
|
|
60
|
+
class ProcessesProvider {
|
|
61
|
+
emitter = new vscode.EventEmitter();
|
|
62
|
+
onDidChangeTreeData = this.emitter.event;
|
|
63
|
+
disposables = [];
|
|
64
|
+
store;
|
|
65
|
+
constructor(store) {
|
|
66
|
+
this.store = store;
|
|
67
|
+
}
|
|
68
|
+
/** Repaint from the store's current state (no fetch — pure projection, #148). */
|
|
69
|
+
refresh() {
|
|
70
|
+
this.emitter.fire(undefined);
|
|
71
|
+
}
|
|
72
|
+
/**
|
|
73
|
+
* The current process-fetch state — the e2e seam for [PROF-UI-PROCESSES]
|
|
74
|
+
* empty-state honesty (#147), mirrored to the `<prefix>.profiler.processesState` key.
|
|
75
|
+
*/
|
|
76
|
+
get processesState() {
|
|
77
|
+
return this.store.processes.value.fetch;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Fetch fresh process data into the store — awaitable, so the manual Refresh
|
|
81
|
+
* command can run it under the view's progress bar ([PROF-UI-STATE]).
|
|
82
|
+
* The resulting revision bump repaints every subscribed view; the silent
|
|
83
|
+
* store-side poll needs no progress bar (a flash every tick would be noise).
|
|
84
|
+
*/
|
|
85
|
+
async refreshNow() {
|
|
86
|
+
await (0, process_poll_1.fetchProcessesIntoStore)(this.store);
|
|
87
|
+
}
|
|
88
|
+
cycleSortMode() {
|
|
89
|
+
const mode = this.store.cycleProcessSort();
|
|
90
|
+
void vscode.window.setStatusBarMessage(`Processes sorted by ${process_explorer_rows_1.SORT_LABEL[mode]}`, STATUS_HINT_MS);
|
|
91
|
+
}
|
|
92
|
+
cycleGroupMode() {
|
|
93
|
+
const mode = this.store.cycleProcessGroup();
|
|
94
|
+
void vscode.window.setStatusBarMessage(`Processes grouped by ${process_explorer_rows_1.GROUP_LABEL[mode]}`, STATUS_HINT_MS);
|
|
95
|
+
}
|
|
96
|
+
setFilter(text) {
|
|
97
|
+
this.store.setProcessFilter(text);
|
|
98
|
+
}
|
|
99
|
+
dispose() {
|
|
100
|
+
for (const disposable of this.disposables) {
|
|
101
|
+
disposable.dispose();
|
|
102
|
+
}
|
|
103
|
+
this.emitter.dispose();
|
|
104
|
+
}
|
|
105
|
+
getTreeItem(element) {
|
|
106
|
+
return element;
|
|
107
|
+
}
|
|
108
|
+
getChildren(element) {
|
|
109
|
+
const state = this.store.processes.value;
|
|
110
|
+
if (element instanceof process_explorer_rows_1.ProcessGroupItem) {
|
|
111
|
+
// Re-sort so non-debuggable rows sink to the bottom *within the group* too,
|
|
112
|
+
// not just in the flat list ([PROF-UI-PROCESSES]).
|
|
113
|
+
return sortProcesses([...element.members], state).map((proc) => this.processRow(proc));
|
|
114
|
+
}
|
|
115
|
+
// Every other row is a leaf. With no processes at all, [] lets the
|
|
116
|
+
// empty/loading/error `viewsWelcome` (which carries the big launch buttons)
|
|
117
|
+
// render honestly.
|
|
118
|
+
if (element !== undefined || state.list.length === 0) {
|
|
119
|
+
return [];
|
|
120
|
+
}
|
|
121
|
+
return this.topLevelRows(state);
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Processes exist, so the welcome can't show: the current-file launches are
|
|
125
|
+
* pinned to the top as rows ([PROF-UI-PROCESSES]), then the processes.
|
|
126
|
+
*/
|
|
127
|
+
topLevelRows(state) {
|
|
128
|
+
const actions = this.launchActionRows();
|
|
129
|
+
const visible = sortProcesses(applyFilter(state), state);
|
|
130
|
+
if (visible.length === 0) {
|
|
131
|
+
// The user's search filter hid every running process — keep the launches
|
|
132
|
+
// and an honest placeholder rather than an empty list (procexp-2).
|
|
133
|
+
return [...actions, new process_explorer_rows_1.MessageTreeItem(filteredEmptyLabel(state))];
|
|
134
|
+
}
|
|
135
|
+
const rows = state.groupMode === "none"
|
|
136
|
+
? visible.map((proc) => this.processRow(proc))
|
|
137
|
+
: buildGroups(visible, state.groupMode);
|
|
138
|
+
return [...actions, ...rows];
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* Render one process row. The "this row is being profiled" marker derives
|
|
142
|
+
* straight from the store's profiler signal — never a provider field (#148) —
|
|
143
|
+
* and the active-debuggee marker from the centralised panel state.
|
|
144
|
+
*/
|
|
145
|
+
processRow(proc) {
|
|
146
|
+
const session = this.store.profiler.value;
|
|
147
|
+
const profilingPid = session.cpu === "active" ? session.cpuPid : undefined;
|
|
148
|
+
const debuggee = this.store.processes.value.activeDebuggeePid;
|
|
149
|
+
return new process_explorer_rows_1.ProcessTreeItem(proc, {
|
|
150
|
+
activeProfilingPid: profilingPid,
|
|
151
|
+
activeDebuggeePid: debuggee,
|
|
152
|
+
runtime: {
|
|
153
|
+
directMemory: this.store.memoryIsDirect(proc.runtime),
|
|
154
|
+
name: this.store.runtimeName(proc.runtime),
|
|
155
|
+
sourceEntries: this.store.sourceEntries(proc.runtime),
|
|
156
|
+
memory: this.store.tracksMemory(proc.runtime),
|
|
157
|
+
},
|
|
158
|
+
});
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* The pinned current-file launch rows, gated per-activity: the CPU launch is
|
|
162
|
+
* hidden while CPU profiling is busy, the memory launch while memory tracking
|
|
163
|
+
* is busy — so a second same-metric run is never offered, yet either can start
|
|
164
|
+
* while the other runs ([PROF-UI-PROCESSES]). A server none of whose runtimes
|
|
165
|
+
* tracks memory never gets the memory launch ([PROF-UI-CAPABILITIES]).
|
|
166
|
+
*/
|
|
167
|
+
launchActionRows() {
|
|
168
|
+
const rows = [];
|
|
169
|
+
if (!this.store.cpuBusy.value) {
|
|
170
|
+
rows.push(new process_explorer_rows_1.LaunchActionItem("Run & Profile CPU (Current File)", (0, ids_1.cmd)("profileCurrentFileCpu"), "flame"));
|
|
171
|
+
}
|
|
172
|
+
if (!this.store.memoryBusy.value && this.store.memoryOffered()) {
|
|
173
|
+
rows.push(new process_explorer_rows_1.LaunchActionItem("Run & Track Memory (Current File)", (0, ids_1.cmd)("trackMemoryCurrentFile"), "database"));
|
|
174
|
+
}
|
|
175
|
+
return rows;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
exports.ProcessesProvider = ProcessesProvider;
|
|
179
|
+
// ── Pure projection helpers (#148) ─────────────────────────────────────────
|
|
180
|
+
/**
|
|
181
|
+
* Sort by the active mode, but always sink non-`debuggable` rows to the bottom
|
|
182
|
+
* so the processes the user can act on stay on top ([PROF-UI-PROCESSES]).
|
|
183
|
+
*/
|
|
184
|
+
function sortProcesses(processes, state) {
|
|
185
|
+
const byMode = process_explorer_rows_1.SORT_COMPARATORS[state.sortMode];
|
|
186
|
+
return processes.toSorted((left, right) => {
|
|
187
|
+
if (left.debuggable !== right.debuggable) {
|
|
188
|
+
return left.debuggable ? -1 : 1;
|
|
189
|
+
}
|
|
190
|
+
return byMode(left, right);
|
|
191
|
+
});
|
|
192
|
+
}
|
|
193
|
+
/** Why the filtered view is empty though processes are running (procexp-2). */
|
|
194
|
+
function filteredEmptyLabel(state) {
|
|
195
|
+
return `No process matches "${state.filterText}" (${String(state.list.length)} running)`;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* Apply only the user's explicit search filter. Enumeration is zero-filter
|
|
199
|
+
* ([PROF-PROCESSES-SCOPE]); the panel never auto-hides a process.
|
|
200
|
+
*/
|
|
201
|
+
function applyFilter(state) {
|
|
202
|
+
if (state.filterText === "") {
|
|
203
|
+
return [...state.list];
|
|
204
|
+
}
|
|
205
|
+
return state.list.filter((proc) => {
|
|
206
|
+
const haystack = `${proc.name} ${proc.script ?? ""} ${String(proc.pid)}`.toLowerCase();
|
|
207
|
+
return haystack.includes(state.filterText);
|
|
208
|
+
});
|
|
209
|
+
}
|
|
210
|
+
function buildGroups(processes, groupMode) {
|
|
211
|
+
const groups = new Map();
|
|
212
|
+
for (const proc of processes) {
|
|
213
|
+
const key = groupKey(proc, groupMode);
|
|
214
|
+
const bucket = groups.get(key);
|
|
215
|
+
if (bucket === undefined) {
|
|
216
|
+
groups.set(key, [proc]);
|
|
217
|
+
}
|
|
218
|
+
else {
|
|
219
|
+
bucket.push(proc);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
return [...groups.entries()]
|
|
223
|
+
.toSorted((left, right) => left[0].localeCompare(right[0]))
|
|
224
|
+
.map(([key, members]) => new process_explorer_rows_1.ProcessGroupItem(key, members));
|
|
225
|
+
}
|
|
226
|
+
function groupKey(proc, groupMode) {
|
|
227
|
+
if (groupMode === "version") {
|
|
228
|
+
return proc.runtimeVersion ?? "Unknown version";
|
|
229
|
+
}
|
|
230
|
+
if (groupMode === "interpreter") {
|
|
231
|
+
return proc.interpreterPath ?? proc.name;
|
|
232
|
+
}
|
|
233
|
+
if (groupMode === "user") {
|
|
234
|
+
return proc.user ?? "Unknown user";
|
|
235
|
+
}
|
|
236
|
+
if (groupMode === "parent") {
|
|
237
|
+
return `Parent ${String(proc.ppid)}`;
|
|
238
|
+
}
|
|
239
|
+
return "";
|
|
240
|
+
}
|
|
241
|
+
//# sourceMappingURL=process-explorer.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-explorer.js","sourceRoot":"","sources":["../../src/process-explorer.ts"],"names":[],"mappings":";AAAA,sEAAsE;AACtE;;;;;;;;;;;;GAYG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,MAAY,MAAM,mCAAe;AACjC,+BAA4B;AAE5B,iDAAyD;AAEzD,mEAQiC;AAQjC,2DAAiE;AAAxD,+HAAA,yBAAyB,OAAA;AAElC,yEAAyE;AACzE,MAAM,cAAc,GAAG,IAAI,CAAC;AAE5B,4EAA4E;AAE5E;IACmB,OAAO,GAAG,IAAI,MAAM,CAAC,YAAY,EAAwB,CAAC;IAC3D,mBAAmB,GAAG,IAAI,CAAC,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;QAAC,OAAO,IAAI,CAAC,IAAI,IAAI,cAAc,CAAC;IAAC,CAAC;IACjE,IAAI,SAAS,KAAK,QAAQ,EAAE,CAAC;QAAC,OAAO,UAAU,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;IAAC,CAAC;IACrE,OAAO,EAAE,CAAC;AACZ,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import * as vscode from "vscode";
|
|
2
|
+
import type { ProcessInfo } from "./process-explorer-rows";
|
|
3
|
+
/** A collapsible group header (when grouping is active). */
|
|
4
|
+
export declare class ProcessGroupItem extends vscode.TreeItem {
|
|
5
|
+
readonly label: string;
|
|
6
|
+
readonly members: readonly ProcessInfo[];
|
|
7
|
+
constructor(label: string, members: readonly ProcessInfo[]);
|
|
8
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.ProcessGroupItem = void 0;
|
|
37
|
+
// Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
|
|
38
|
+
const vscode = __importStar(require("vscode"));
|
|
39
|
+
/** A collapsible group header (when grouping is active). */
|
|
40
|
+
class ProcessGroupItem extends vscode.TreeItem {
|
|
41
|
+
label;
|
|
42
|
+
members;
|
|
43
|
+
constructor(label, members) {
|
|
44
|
+
super(label, vscode.TreeItemCollapsibleState.Expanded);
|
|
45
|
+
this.label = label;
|
|
46
|
+
this.members = members;
|
|
47
|
+
// Stable identity so VS Code preserves expansion state across refreshes.
|
|
48
|
+
this.id = `processGroup:${label}`;
|
|
49
|
+
this.description = String(members.length);
|
|
50
|
+
this.contextValue = "processGroup";
|
|
51
|
+
this.iconPath = new vscode.ThemeIcon("folder");
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.ProcessGroupItem = ProcessGroupItem;
|
|
55
|
+
//# sourceMappingURL=process-group-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-group-item.js","sourceRoot":"","sources":["../../src/process-group-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsE;AACtE,MAAY,MAAM,mCAAe;AAGjC,4DAA4D;AAC5D,sBAA8B,SAAQ,MAAM,CAAC,QAAQ;IACnC,KAAK,CAAS;IACd,OAAO,CAAyB;IAChD,YAAmB,KAAa,EAAE,OAA+B;QAC/D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC;QACvD,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,yEAAyE;QACzE,IAAI,CAAC,EAAE,GAAG,gBAAgB,KAAK,EAAE,CAAC;QAClC,IAAI,CAAC,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC;QAC1C,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IACjD,CAAC;CACF"}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import * as vscode from "vscode";
|
|
2
|
+
/**
|
|
3
|
+
* A persistent "Run & …(Current File)" launch row pinned to the top of the tree.
|
|
4
|
+
* VS Code only renders the big `viewsWelcome` buttons when the tree is EMPTY, so
|
|
5
|
+
* once any process appears those buttons vanish — these rows keep the current-file
|
|
6
|
+
* launches reachable alongside a populated list ([PROF-UI-PROCESSES]).
|
|
7
|
+
* Gated per-activity (hidden while the matching metric is busy) like the title-bar
|
|
8
|
+
* buttons, so a second same-metric run is never offered ([PROF-UI-PROCESSES]).
|
|
9
|
+
*/
|
|
10
|
+
export declare class LaunchActionItem extends vscode.TreeItem {
|
|
11
|
+
constructor(label: string, command: string, icon: string);
|
|
12
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.LaunchActionItem = void 0;
|
|
37
|
+
// Implements [PROF-UI-PROCESSES]. See docs/specs/LSP-PROFILER-SPEC.md
|
|
38
|
+
const vscode = __importStar(require("vscode"));
|
|
39
|
+
/**
|
|
40
|
+
* A persistent "Run & …(Current File)" launch row pinned to the top of the tree.
|
|
41
|
+
* VS Code only renders the big `viewsWelcome` buttons when the tree is EMPTY, so
|
|
42
|
+
* once any process appears those buttons vanish — these rows keep the current-file
|
|
43
|
+
* launches reachable alongside a populated list ([PROF-UI-PROCESSES]).
|
|
44
|
+
* Gated per-activity (hidden while the matching metric is busy) like the title-bar
|
|
45
|
+
* buttons, so a second same-metric run is never offered ([PROF-UI-PROCESSES]).
|
|
46
|
+
*/
|
|
47
|
+
class LaunchActionItem extends vscode.TreeItem {
|
|
48
|
+
constructor(label, command, icon) {
|
|
49
|
+
super(label, vscode.TreeItemCollapsibleState.None);
|
|
50
|
+
this.id = `launchAction:${command}`;
|
|
51
|
+
this.contextValue = "launchAction";
|
|
52
|
+
this.iconPath = new vscode.ThemeIcon(icon, new vscode.ThemeColor("textLink.foreground"));
|
|
53
|
+
this.command = { command, title: label };
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
exports.LaunchActionItem = LaunchActionItem;
|
|
57
|
+
//# sourceMappingURL=process-launch-item.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"process-launch-item.js","sourceRoot":"","sources":["../../src/process-launch-item.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,sEAAsE;AACtE,MAAY,MAAM,mCAAe;AAEjC;;;;;;;GAOG;AACH,sBAA8B,SAAQ,MAAM,CAAC,QAAQ;IACnD,YAAmB,KAAa,EAAE,OAAe,EAAE,IAAY;QAC7D,KAAK,CAAC,KAAK,EAAE,MAAM,CAAC,wBAAwB,CAAC,IAAI,CAAC,CAAC;QACnD,IAAI,CAAC,EAAE,GAAG,gBAAgB,OAAO,EAAE,CAAC;QACpC,IAAI,CAAC,YAAY,GAAG,cAAc,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,IAAI,MAAM,CAAC,SAAS,CAAC,IAAI,EAAE,IAAI,MAAM,CAAC,UAAU,CAAC,qBAAqB,CAAC,CAAC,CAAC;QACzF,IAAI,CAAC,OAAO,GAAG,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC;IAC3C,CAAC;CACF"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Launch actions for the Processes panel.
|
|
3
|
+
*
|
|
4
|
+
* Two surfaces, one language: per-row inline actions ("Profile CPU" 🔥 /
|
|
5
|
+
* "Track Memory" 🗄️ — the #62 fix, hardened for #79) and the metric-explicit
|
|
6
|
+
* title-bar launches for the current file ("Run & Profile CPU" / "Run & Track
|
|
7
|
+
* Memory" — the #82 fix). The tree rendering lives in process-explorer.ts;
|
|
8
|
+
* this module owns what happens when the user clicks.
|
|
9
|
+
*/
|
|
10
|
+
import * as vscode from "vscode";
|
|
11
|
+
import type { ProfilerStore as Store } from "./store";
|
|
12
|
+
/** The slice of the panel's TreeView the launch actions read (test seam). */
|
|
13
|
+
export interface ProcessRowSource {
|
|
14
|
+
readonly selection: readonly vscode.TreeItem[];
|
|
15
|
+
}
|
|
16
|
+
/** Where a row's Track Memory action routes. */
|
|
17
|
+
export type MemoryTrackRoute = "start-tracking" | "offer-launch";
|
|
18
|
+
/** The slice of a debug session the memory route needs (test seam). */
|
|
19
|
+
type SessionRef = Pick<vscode.DebugSession, "id" | "type">;
|
|
20
|
+
/** Injectable environment for the row actions (test seam, like ProcessRowSource). */
|
|
21
|
+
export interface ProcessRowDeps {
|
|
22
|
+
readonly runCommand: (command: string, ...args: unknown[]) => Thenable<unknown>;
|
|
23
|
+
readonly activeSession: () => SessionRef | undefined;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Memory tracking rides the DAP-`evaluate` courier ([PROF-UI-MEMORY]),
|
|
27
|
+
* so it can only ever target the live host debuggee — tracemalloc cannot
|
|
28
|
+
* be injected into an arbitrary external PID. Anything else routes to the
|
|
29
|
+
* "launch it under the debugger" offer instead of silently starting the wrong
|
|
30
|
+
* (CPU) profiler.
|
|
31
|
+
*/
|
|
32
|
+
export declare function memoryTrackRoute(store: Store, pid: number, session: SessionRef | undefined): MemoryTrackRoute;
|
|
33
|
+
/**
|
|
34
|
+
* The per-row launch handlers exactly as VS Code invokes them for the inline
|
|
35
|
+
* buttons and context menu. Exported so tests can drive the real command
|
|
36
|
+
* surface, including the no-argument invocation of issue #79.
|
|
37
|
+
*/
|
|
38
|
+
export declare function createProcessRowActions(store: Store, view: ProcessRowSource, deps?: ProcessRowDeps): {
|
|
39
|
+
readonly profileProcess: (item?: vscode.TreeItem) => Promise<void>;
|
|
40
|
+
readonly memoryTrackProcess: (item?: vscode.TreeItem) => Promise<void>;
|
|
41
|
+
};
|
|
42
|
+
/** Which metric a metric-explicit "Run & …" launch tracks (#82). */
|
|
43
|
+
export type { LaunchMetric } from "./host";
|
|
44
|
+
/** What to open before "run & profile", naming the host's languages as a user knows them ([PROF-UI-HOST]). */
|
|
45
|
+
export declare function openFileToProfile(languageNames: readonly string[]): string;
|
|
46
|
+
/** Register every launch command the Processes panel contributes. */
|
|
47
|
+
export declare function registerLaunchCommands(store: Store, view: ProcessRowSource): vscode.Disposable[];
|