This repository was archived by the owner on Jan 9, 2026. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +20
-0
lines changed
Expand file tree Collapse file tree 1 file changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,21 @@ interface CallStackCache {
6868 lastUpdated : string ;
6969}
7070
71+ /**
72+ * Helper function to check if a file path is a test file
73+ */
74+ function isTestPath ( filePath : string ) : boolean {
75+ const normalizedPath = filePath . toLowerCase ( ) ;
76+ return normalizedPath . includes ( '/test/' ) ||
77+ normalizedPath . includes ( '/tests/' ) ||
78+ normalizedPath . includes ( '/__tests__/' ) ||
79+ normalizedPath . includes ( '/__test__/' ) ||
80+ normalizedPath . includes ( '.test.' ) ||
81+ normalizedPath . includes ( '.spec.' ) ||
82+ normalizedPath . includes ( '_test.' ) ||
83+ normalizedPath . includes ( '_spec.' ) ;
84+ }
85+
7186/**
7287 * TreeItem for call stack entries in the Call Stack Explorer
7388 */
@@ -334,6 +349,11 @@ export class CallStackExplorerProvider implements vscode.TreeDataProvider<CallSt
334349
335350 if ( locations ) {
336351 for ( const location of locations ) {
352+ // Skip test files
353+ if ( isTestPath ( location . uri . fsPath ) ) {
354+ continue ;
355+ }
356+
337357 // Skip self-references (the function definition itself)
338358 if ( location . uri . fsPath === sourceFile &&
339359 location . range . start . line === selectionRange . start . line ) {
You can’t perform that action at this time.
0 commit comments