Skip to content

Commit

Permalink
fix(vscode): newly created file failed to match tsconfig immediately
Browse files Browse the repository at this point in the history
  • Loading branch information
johnsoncodehk committed Mar 28, 2024
1 parent a414785 commit baf5a99
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/vscode/lib/features/tsconfig.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,16 @@ export function activate(

const subscriptions: vscode.Disposable[] = [];
const statusBar = vscode.languages.createLanguageStatusItem(cmd, selector);

let currentTsconfigUri: vscode.Uri | undefined;
let updateStatus: ReturnType<typeof setTimeout> | undefined;

updateStatusBar();

vscode.window.onDidChangeActiveTextEditor(updateStatusBar, undefined, subscriptions);
vscode.window.onDidChangeActiveTextEditor(() => {
clearTimeout(updateStatus);
updateStatus = setTimeout(() => updateStatusBar, 100);
}, undefined, subscriptions);

subscriptions.push(vscode.commands.registerCommand(cmd, async () => {
if (currentTsconfigUri) {
Expand Down

0 comments on commit baf5a99

Please sign in to comment.