Skip to content

Commit 60d7328

Browse files
committed
Changes from user feedback
1 parent 5b4c18a commit 60d7328

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/utils/documentIndex.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const wsFolderIndex: Map<string, WSFolderIndex> = new Map();
3939
const textDecoder = new TextDecoder("utf-8", { fatal: true });
4040

4141
/** The number of milliseconds that we should wait before sending a compile or delete request */
42-
const debounceDelay = 500;
42+
const debounceDelay = 1000;
4343

4444
/**
4545
* Create an object describing the file in `uri`.
@@ -219,8 +219,8 @@ export async function indexWorkspaceFolder(wsFolder: vscode.WorkspaceFolder): Pr
219219
const api = new AtelierAPI(uri);
220220
const conf = vscode.workspace.getConfiguration("objectscript", wsFolder);
221221
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));
224224
touchedByVSCode.delete(uriString);
225225
let change: WSFolderIndexChange = {};
226226
if (isClassOrRtn(uri)) {
@@ -237,7 +237,7 @@ export async function indexWorkspaceFolder(wsFolder: vscode.WorkspaceFolder): Pr
237237
// Compile right away if this document is in the active text editor.
238238
// This is needed to avoid noticeable latency when a user is editing
239239
// 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) {
241241
compile([change.addedOrChanged]);
242242
} else {
243243
debouncedCompile(change.addedOrChanged);

0 commit comments

Comments
 (0)