File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -55,7 +55,7 @@ export function filterStack(stack: string): string {
5555 for ( const line of stack . split ( "\n" ) ) {
5656 if ( frames . length >= 20 ) break ;
5757
58- const match = line . match ( / a t ( \S + ) / ) ;
58+ const match = line . match ( / a t ( (?: a s y n c ) ? \S + ) / ) ;
5959 if ( ! match ) continue ;
6060
6161 const name = match [ 1 ] ;
Original file line number Diff line number Diff line change @@ -90,4 +90,15 @@ suite("Telemetry Tests", () => {
9090 const filtered = Telemetry . filterStack ( stack ) ;
9191 expect ( filtered ) . to . equal ( "Object.update < UserCode.run" ) ;
9292 } ) ;
93+
94+ test ( "filterStack should handle async functions correctly" , ( ) => {
95+ const stack = `Error:
96+ at ConnectionManager.connect (/path/to/file.ts:10:10)
97+ at async ObjectExplorerService.createSessionAndExpandNode (/path/to/file.ts:20:20)` ;
98+
99+ const filtered = Telemetry . filterStack ( stack ) ;
100+ expect ( filtered ) . to . equal (
101+ "ConnectionManager.connect < async ObjectExplorerService.createSessionAndExpandNode" ,
102+ ) ;
103+ } ) ;
93104} ) ;
You can’t perform that action at this time.
0 commit comments