-
Notifications
You must be signed in to change notification settings - Fork 20
feat: Debugger Diagnostics C++ driven displays and data #393
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
AlexDenfordSkyboxLabs
merged 28 commits into
main
from
sbl/alex.denford/debugger-native-descriptors
Jun 30, 2026
Merged
Changes from all commits
Commits
Show all changes
28 commits
Select commit
Hold shift + click to select a range
3eda824
wip
AlexDenfordSkyboxLabs ee74ea5
remove descriptor changes
AlexDenfordSkyboxLabs 870c27c
fixes
AlexDenfordSkyboxLabs 75672f2
Merge branch 'main' into sbl/alex.denford/debugger-investigation
AlexDenfordSkyboxLabs 4553d18
merge
AlexDenfordSkyboxLabs 50c52ba
fixes/merge
AlexDenfordSkyboxLabs 863d46d
fixes
AlexDenfordSkyboxLabs e462c47
Update session.ts
AlexDenfordSkyboxLabs fa1d26e
remove
AlexDenfordSkyboxLabs 4614baa
feedback
AlexDenfordSkyboxLabs 24f294e
Update protocol-events.ts
AlexDenfordSkyboxLabs 4f7416d
Update package-lock.json
AlexDenfordSkyboxLabs a9ea44a
Update package-lock.json
AlexDenfordSkyboxLabs 97d25d6
Update package-lock.json
AlexDenfordSkyboxLabs 0cefdc5
tweaks
AlexDenfordSkyboxLabs 7c8efc8
legacy support
AlexDenfordSkyboxLabs 5a2baed
Update request-manager.ts
AlexDenfordSkyboxLabs 38b9c3c
Merge branch 'main' into sbl/alex.denford/debugger-native-descriptors
AlexDenfordSkyboxLabs 1b70c43
diagnostics
AlexDenfordSkyboxLabs 0e36a1b
iteration
AlexDenfordSkyboxLabs 3409c83
remove the now c++ driven schema, sort native ones
AlexDenfordSkyboxLabs 0e61340
Scaling, fixing highlight, launch settings
AlexDenfordSkyboxLabs 73dfe72
Re-add client memory & timing for backwards compatabilikty
AlexDenfordSkyboxLabs c90e2fe
linter
AlexDenfordSkyboxLabs f9010a5
better tip display options
AlexDenfordSkyboxLabs 6e1bac4
Update LineChart.tsx
AlexDenfordSkyboxLabs 90ddf8d
change to use memo, use vs code style
AlexDenfordSkyboxLabs 4637541
Merge branch 'main' into sbl/alex.denford/debugger-native-descriptors
AlexDenfordSkyboxLabs File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,14 +1,16 @@ | ||
| // Copyright (C) Microsoft Corporation. All rights reserved. | ||
|
|
||
| import { StatGroupSelectionBox } from './controls/StatGroupSelectionBox'; | ||
| import { useCallback, useEffect, useState } from 'react'; | ||
| import { useCallback, useEffect, useMemo, useState } from 'react'; | ||
| import ReplayControls from './controls/ReplayControls'; | ||
| import { Icons } from './Icons'; | ||
| import './App.css'; | ||
| import tabPrefabs from './prefabs'; | ||
| import { TabPrefab, TabPrefabDataSource, TabPrefabParams } from './prefabs/TabPrefab'; | ||
| import { handleDebuggerRequestResult } from './utilities/useDebuggerRequests'; | ||
| import { vscode } from './utilities/vscode'; | ||
| import { DiagnosticsTabDescriptor } from './DiagnosticsSchema'; | ||
| import DynamicTab from './DynamicTab'; | ||
|
|
||
| // Wraps each tab's content() as a proper React component so that any hooks | ||
| // inside the content function are correctly isolated and not called conditionally | ||
|
|
@@ -17,6 +19,13 @@ function TabView({ tabPrefab, params }: { tabPrefab: TabPrefab; params: TabPrefa | |
| return <>{tabPrefab.content(params)}</>; | ||
| } | ||
|
|
||
| const sortedTabPrefabs = [...tabPrefabs].sort((a, b) => a.name.localeCompare(b.name)); | ||
|
|
||
| // A tab entry is either a hardcoded prefab or a dynamic descriptor received from the game. | ||
| type MergedTab = | ||
| | { kind: 'prefab'; name: string; tab: TabPrefab } | ||
| | { kind: 'dynamic'; name: string; descriptor: DiagnosticsTabDescriptor }; | ||
|
|
||
| declare global { | ||
| interface Window { | ||
| initialParams: any; | ||
|
|
@@ -52,12 +61,13 @@ const CLIENT_SELECTION_HELP_TOOLTIP = | |
| 'Please enable "Creator > Script Diagnostics Settings > Enable Client Diagnostics" from within the game settings.'; | ||
|
|
||
| function App() { | ||
| const sortedTabPrefabs = [...tabPrefabs].sort((a, b) => a.name.localeCompare(b.name)); | ||
| const [selectedPlugin, setSelectedPlugin] = useState<string>(''); | ||
| const [selectedClient, setSelectedClient] = useState<string>(''); | ||
| const [currentTab, setCurrentTab] = useState<string>('tab-0'); | ||
| const [paused, setPaused] = useState<boolean>(true); | ||
| const [speed, setSpeed] = useState<string>(''); | ||
| // Dynamic schema received from the game on connect. Merged into the prefab tab list. | ||
| const [schema, setSchema] = useState<DiagnosticsTabDescriptor[]>([]); | ||
|
|
||
| const handlePluginSelection = useCallback((pluginSelectionId: string) => { | ||
| setSelectedPlugin(() => pluginSelectionId); | ||
|
|
@@ -76,6 +86,8 @@ function App() { | |
| setPaused(message.paused); | ||
| } else if (message.type === 'debugger-request-result') { | ||
| handleDebuggerRequestResult(message); | ||
| } else if (message.type === 'diagnostics-schema') { | ||
| setSchema(message.schema as DiagnosticsTabDescriptor[]); | ||
| } | ||
| }; | ||
| window.addEventListener('message', handleMessage); | ||
|
|
@@ -84,6 +96,26 @@ function App() { | |
| }; | ||
| }, [handleDebuggerRequestResult]); | ||
|
|
||
| // Merge schema tabs into the prefab list. Schema tabs whose name matches a prefab replace it; | ||
| // new names are appended. Falls back to all prefabs when no schema has arrived yet. | ||
| const mergedTabs: MergedTab[] = useMemo(() => { | ||
| const merged: MergedTab[] = sortedTabPrefabs.map(tab => ({ | ||
| kind: 'prefab' as const, | ||
| name: tab.name, | ||
| tab, | ||
| })); | ||
| for (const descriptor of schema) { | ||
| const existingIndex = merged.findIndex(t => t.name === descriptor.name); | ||
| if (existingIndex !== -1) { | ||
| merged[existingIndex] = { kind: 'dynamic' as const, name: descriptor.name, descriptor }; | ||
| } else { | ||
| merged.push({ kind: 'dynamic' as const, name: descriptor.name, descriptor }); | ||
| } | ||
| } | ||
| merged.sort((a, b) => a.name.localeCompare(b.name)); | ||
| return merged; | ||
| }, [schema]); | ||
|
|
||
|
Comment on lines
+99
to
+118
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be under a hook, in this case useMemo. |
||
| return ( | ||
| <main> | ||
| {window.initialParams.showReplayControls && ( | ||
|
|
@@ -100,18 +132,18 @@ function App() { | |
| )} | ||
| <div className="vertical-tabs-container"> | ||
| <div className="vertical-tab-list"> | ||
| {sortedTabPrefabs.map((tabPrefab, index) => ( | ||
| {mergedTabs.map((tab, index) => ( | ||
| <button | ||
| key={`tab-${index}`} | ||
| className={`vertical-tab-item${currentTab === `tab-${index}` ? ' active' : ''}`} | ||
| onClick={() => setCurrentTab(`tab-${index}`)} | ||
| > | ||
| {tabPrefab.name} | ||
| {tab.name} | ||
| </button> | ||
| ))} | ||
| </div> | ||
| <div className="vertical-tab-content"> | ||
| {sortedTabPrefabs.map((tabPrefab, index) => ( | ||
| {mergedTabs.map((tab, index) => ( | ||
| <div | ||
| key={`view-${index}`} | ||
| style={{ | ||
|
|
@@ -120,26 +152,53 @@ function App() { | |
| flex: 1, | ||
| }} | ||
| > | ||
| {tabPrefab.dataSource === TabPrefabDataSource.Client ? ( | ||
| <StatGroupSelectionBox | ||
| labelName="Client" | ||
| statParentId="client_stats" | ||
| onChange={handleClientSelection} | ||
| helpTooltip={CLIENT_SELECTION_HELP_TOOLTIP} | ||
| /> | ||
| ) : ( | ||
| <div /> | ||
| )} | ||
| {tabPrefab.dataSource === TabPrefabDataSource.ServerScript ? ( | ||
| <StatGroupSelectionBox | ||
| labelName="Script Plugin" | ||
| statParentId="handle_counts" | ||
| onChange={handlePluginSelection} | ||
| /> | ||
| {tab.kind === 'prefab' ? ( | ||
| <> | ||
| {tab.tab.dataSource === TabPrefabDataSource.Client ? ( | ||
| <StatGroupSelectionBox | ||
| labelName="Client" | ||
| statParentId="client_stats" | ||
| onChange={handleClientSelection} | ||
| helpTooltip={CLIENT_SELECTION_HELP_TOOLTIP} | ||
| /> | ||
| ) : ( | ||
| <div /> | ||
| )} | ||
| {tab.tab.dataSource === TabPrefabDataSource.ServerScript ? ( | ||
| <StatGroupSelectionBox | ||
| labelName="Script Plugin" | ||
| statParentId="handle_counts" | ||
| onChange={handlePluginSelection} | ||
| /> | ||
| ) : ( | ||
| <div /> | ||
| )} | ||
| <TabView tabPrefab={tab.tab} params={{ selectedClient, selectedPlugin, onRunCommand }} /> | ||
| </> | ||
| ) : ( | ||
| <div /> | ||
| <> | ||
| {tab.descriptor.data_source === 'client' && ( | ||
| <StatGroupSelectionBox | ||
| labelName="Client" | ||
| statParentId="client_stats" | ||
| onChange={handleClientSelection} | ||
| helpTooltip={CLIENT_SELECTION_HELP_TOOLTIP} | ||
| /> | ||
| )} | ||
| {tab.descriptor.data_source === 'server_script' && ( | ||
| <StatGroupSelectionBox | ||
| labelName="Script Plugin" | ||
| statParentId="handle_counts" | ||
| onChange={handlePluginSelection} | ||
| /> | ||
| )} | ||
| <DynamicTab | ||
| descriptor={tab.descriptor} | ||
| selectedClient={selectedClient} | ||
| selectedPlugin={selectedPlugin} | ||
| /> | ||
| </> | ||
| )} | ||
| <TabView tabPrefab={tabPrefab} params={{ selectedClient, selectedPlugin, onRunCommand }} /> | ||
| </div> | ||
| ))} | ||
| </div> | ||
|
|
||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm thinking that this extension needs a custom output, to show all here.
Not for these changes.