@@ -39,7 +39,7 @@ const wsFolderIndex: Map<string, WSFolderIndex> = new Map();
39
39
const textDecoder = new TextDecoder ( "utf-8" , { fatal : true } ) ;
40
40
41
41
/** The number of milliseconds that we should wait before sending a compile or delete request */
42
- const debounceDelay = 500 ;
42
+ const debounceDelay = 1000 ;
43
43
44
44
/**
45
45
* Create an object describing the file in `uri`.
@@ -219,8 +219,8 @@ export async function indexWorkspaceFolder(wsFolder: vscode.WorkspaceFolder): Pr
219
219
const api = new AtelierAPI ( uri ) ;
220
220
const conf = vscode . workspace . getConfiguration ( "objectscript" , wsFolder ) ;
221
221
const syncLocalChanges : string = conf . get ( "syncLocalChanges" ) ;
222
- const sync : boolean =
223
- api . active && ( syncLocalChanges == "all" || ( syncLocalChanges == "vscodeOnly" && touchedByVSCode . has ( uriString ) ) ) ;
222
+ const vscodeChange = touchedByVSCode . has ( uriString ) ;
223
+ const sync = api . active && ( syncLocalChanges == "all" || ( syncLocalChanges == "vscodeOnly" && vscodeChange ) ) ;
224
224
touchedByVSCode . delete ( uriString ) ;
225
225
let change : WSFolderIndexChange = { } ;
226
226
if ( isClassOrRtn ( uri ) ) {
@@ -237,7 +237,7 @@ export async function indexWorkspaceFolder(wsFolder: vscode.WorkspaceFolder): Pr
237
237
// Compile right away if this document is in the active text editor.
238
238
// This is needed to avoid noticeable latency when a user is editing
239
239
// a client-side file, saves it, and the auto-compile kicks in.
240
- if ( vscode . window . activeTextEditor ?. document . uri . toString ( ) == uriString ) {
240
+ if ( vscodeChange && vscode . window . activeTextEditor ?. document . uri . toString ( ) == uriString ) {
241
241
compile ( [ change . addedOrChanged ] ) ;
242
242
} else {
243
243
debouncedCompile ( change . addedOrChanged ) ;
0 commit comments