@@ -4,7 +4,8 @@ import { DebugProtocol } from "@vscode/debugprotocol";
44import { DebugSessionTracker } from "../debug-session-tracker" ;
55import { DisposableContext } from "../disposable-context" ;
66
7- import { DAPSymbolType } from ".." ;
7+ import { SymbolType } from ".." ;
8+ import { getSymbolsTableHTMLContent } from "./symbols-webview-html" ;
89import { getDefaultConfigKey } from "../debug-configuration-provider" ;
910
1011export class SymbolsProvider extends DisposableContext {
@@ -95,12 +96,12 @@ export class SymbolsProvider extends DisposableContext {
9596 }
9697 }
9798
98- private async getSymbolsForModule ( session : vscode . DebugSession , moduleId : string ) : Promise < DAPSymbolType [ ] > {
99- const symbols_response : { symbols : Array < DAPSymbolType > } = await session . customRequest ( "moduleSymbols" , { moduleId, moduleName : '' } ) ;
99+ private async getSymbolsForModule ( session : vscode . DebugSession , moduleId : string ) : Promise < SymbolType [ ] > {
100+ const symbols_response : { symbols : Array < SymbolType > } = await session . customRequest ( "moduleSymbols" , { moduleId, moduleName : '' } ) ;
100101 return symbols_response ?. symbols || [ ] ;
101102 }
102103
103- private async showSymbolsInNewTab ( moduleName : string , symbols : DAPSymbolType [ ] ) {
104+ private async showSymbolsInNewTab ( moduleName : string , symbols : SymbolType [ ] ) {
104105 const panel = vscode . window . createWebviewPanel (
105106 "lldb-dap.symbols" ,
106107 `Symbols for ${ moduleName } ` ,
@@ -121,60 +122,10 @@ export class SymbolsProvider extends DisposableContext {
121122 const tabulatorJsPath = panel . webview . asWebviewUri ( vscode . Uri . joinPath ( this . getExtensionResourcePath ( ) , "tabulator.min.js" ) ) ;
122123 const symbolsTableScriptPath = panel . webview . asWebviewUri ( vscode . Uri . joinPath ( this . getExtensionResourcePath ( ) , "symbols-table-view.js" ) ) ;
123124
124- panel . webview . html = this . getHTMLContentForSymbols ( tabulatorJsPath , tabulatorCssPath , symbolsTableScriptPath ) ;
125+ panel . webview . html = getSymbolsTableHTMLContent ( tabulatorJsPath , tabulatorCssPath , symbolsTableScriptPath ) ;
125126 panel . webview . postMessage ( { command : "updateSymbols" , symbols : symbols } ) ;
126127 }
127128
128- private getHTMLContentForSymbols ( tabulatorJsPath : vscode . Uri , tabulatorCssPath : vscode . Uri , symbolsTableScriptPath : vscode . Uri ) : string {
129- return `<!DOCTYPE html>
130- <html>
131- <head>
132- <meta charset="UTF-8">
133- <link href="${ tabulatorCssPath } " rel="stylesheet">
134- <style>
135- .tabulator {
136- background-color: var(--vscode-editor-background);
137- color: var(--vscode-editor-foreground);
138- }
139-
140- .tabulator .tabulator-header .tabulator-col {
141- background-color: var(--vscode-editor-background);
142- color: var(--vscode-editor-foreground);
143- }
144-
145- .tabulator-row {
146- background-color: var(--vscode-editor-background);
147- color: var(--vscode-editor-foreground);
148- }
149-
150- .tabulator-row.tabulator-row-even {
151- background-color: var(--vscode-editor-background);
152- color: var(--vscode-editor-foreground);
153- }
154-
155- .tabulator-row.tabulator-selected {
156- background-color: var(--vscode-editor-background);
157- color: var(--vscode-editor-foreground);
158- }
159-
160- .tabulator-cell {
161- text-overflow: clip !important;
162- }
163-
164- #symbols-table {
165- width: 100%;
166- height: 100vh;
167- }
168- </style>
169- </head>
170- <body>
171- <div id="symbols-table"></div>
172- <script src="${ tabulatorJsPath } "></script>
173- <script src="${ symbolsTableScriptPath } "></script>
174- </body>
175- </html>` ;
176- }
177-
178129 private getExtensionResourcePath ( ) : vscode . Uri {
179130 return vscode . Uri . joinPath ( this . extensionContext . extensionUri , "out" , "webview" ) ;
180131 }
0 commit comments