From da53c28c23f889bbba2ba1c4f06f002eeb794848 Mon Sep 17 00:00:00 2001 From: Brett Saviano Date: Thu, 22 May 2025 09:28:07 -0400 Subject: [PATCH] Fix `objectscript.autoAdjustName` behavior with `Save As...` --- src/extension.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/extension.ts b/src/extension.ts index 523039a3..8adac4d3 100644 --- a/src/extension.ts +++ b/src/extension.ts @@ -1262,6 +1262,10 @@ export async function activate(context: vscode.ExtensionContext): Promise { // No workspace folders are open return; } + // Need to wait in case file was created using "Save As..." + // because in that case the file gets created without + // content, and then the content is written in after that + await new Promise((resolve) => setTimeout(resolve, 100)); const sourceContent = await vscode.workspace.fs.readFile(uri); if ( sourceContent.length &&