diff --git a/extensions/vscode/src/extension/VsCodeExtension.ts b/extensions/vscode/src/extension/VsCodeExtension.ts index ce12a0a6b..f2a6b8b70 100644 --- a/extensions/vscode/src/extension/VsCodeExtension.ts +++ b/extensions/vscode/src/extension/VsCodeExtension.ts @@ -24,6 +24,7 @@ import { getControlPlaneSessionInfo, WorkOsAuthProvider, } from "../stubs/WorkOsAuthProvider"; +import { arePathsEqual } from "../util/arePathsEqual"; import { Battery } from "../util/battery"; import { AUTH_TYPE, EXTENSION_NAME } from "../util/constants"; import { TabAutocompleteModel } from "../util/loadAutocompleteModel"; @@ -228,7 +229,7 @@ export class VsCodeExtension { // Listen for file changes in the workspace const filepath = event.uri.fsPath; - if (filepath === getConfigJsonPath()) { + if (arePathsEqual(filepath, getConfigJsonPath())) { // Trigger a toast notification to provide UI feedback that config // has been updated const showToast = context.globalState.get( diff --git a/extensions/vscode/src/util/arePathsEqual.ts b/extensions/vscode/src/util/arePathsEqual.ts new file mode 100644 index 000000000..cd10e5399 --- /dev/null +++ b/extensions/vscode/src/util/arePathsEqual.ts @@ -0,0 +1,11 @@ +import * as os from "os"; + +export function arePathsEqual(path1: string, path2: string): boolean { + if (os.platform() === "win32") { + // On Windows, compare paths case-insensitively + return path1.toLowerCase() === path2.toLowerCase(); + } else { + // On other platforms, compare paths case-sensitively + return path1 === path2; + } +}