@@ -5,7 +5,13 @@ import { red, yellow } from "ansi-colors";
5
5
import * as vscode from "vscode" ;
6
6
import { DebugManager } from "./debugmanager" ;
7
7
8
- import { ClientState , LanguageClientsManager , toVsCodeRange , SUPPORTED_LANGUAGES } from "./languageclientsmanger" ;
8
+ import {
9
+ ClientState ,
10
+ LanguageClientsManager ,
11
+ toVsCodeRange ,
12
+ SUPPORTED_LANGUAGES ,
13
+ SUPPORTED_SUITE_FILE_EXTENSIONS ,
14
+ } from "./languageclientsmanger" ;
9
15
import { filterAsync , Mutex , sleep , WeakValueMap } from "./utils" ;
10
16
import { CONFIG_SECTION } from "./config" ;
11
17
import { Range , Diagnostic , DiagnosticSeverity } from "vscode-languageclient/node" ;
@@ -220,11 +226,8 @@ export class TestControllerManager {
220
226
} ) ,
221
227
vscode . workspace . onDidCloseTextDocument ( ( document ) => this . refreshDocument ( document ) ) ,
222
228
vscode . workspace . onDidSaveTextDocument ( ( document ) => this . refreshDocument ( document ) ) ,
223
- vscode . workspace . onDidOpenTextDocument ( async ( document ) => {
224
- if ( ! SUPPORTED_LANGUAGES . includes ( document . languageId ) ) return ;
229
+ vscode . workspace . onDidOpenTextDocument ( ( document ) => this . refreshDocument ( document ) ) ,
225
230
226
- await this . refresh ( this . findTestItemForDocument ( document ) ) ;
227
- } ) ,
228
231
vscode . workspace . onDidChangeTextDocument ( ( event ) => {
229
232
this . refreshDocument ( event . document ) ;
230
233
} ) ,
@@ -436,6 +439,7 @@ export class TestControllerManager {
436
439
437
440
public refreshDocument ( document : vscode . TextDocument ) : void {
438
441
if ( ! SUPPORTED_LANGUAGES . includes ( document . languageId ) ) return ;
442
+ if ( ! SUPPORTED_SUITE_FILE_EXTENSIONS . some ( ( ext ) => document . uri . path . endsWith ( ext ) ) ) return ;
439
443
440
444
const uri_str = document . uri . toString ( ) ;
441
445
if ( this . didChangedTimer . has ( uri_str ) ) {
0 commit comments