@@ -5,7 +5,13 @@ import { red, yellow } from "ansi-colors";
55import * as vscode from "vscode" ;
66import { DebugManager } from "./debugmanager" ;
77
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" ;
915import { filterAsync , Mutex , sleep , WeakValueMap } from "./utils" ;
1016import { CONFIG_SECTION } from "./config" ;
1117import { Range , Diagnostic , DiagnosticSeverity } from "vscode-languageclient/node" ;
@@ -220,11 +226,8 @@ export class TestControllerManager {
220226 } ) ,
221227 vscode . workspace . onDidCloseTextDocument ( ( document ) => this . refreshDocument ( document ) ) ,
222228 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 ) ) ,
225230
226- await this . refresh ( this . findTestItemForDocument ( document ) ) ;
227- } ) ,
228231 vscode . workspace . onDidChangeTextDocument ( ( event ) => {
229232 this . refreshDocument ( event . document ) ;
230233 } ) ,
@@ -436,6 +439,7 @@ export class TestControllerManager {
436439
437440 public refreshDocument ( document : vscode . TextDocument ) : void {
438441 if ( ! SUPPORTED_LANGUAGES . includes ( document . languageId ) ) return ;
442+ if ( ! SUPPORTED_SUITE_FILE_EXTENSIONS . some ( ( ext ) => document . uri . path . endsWith ( ext ) ) ) return ;
439443
440444 const uri_str = document . uri . toString ( ) ;
441445 if ( this . didChangedTimer . has ( uri_str ) ) {
0 commit comments