continuedev / continue

⏩ Continue is the leading open-source AI code assistant. You can connect any models and any context to build custom autocomplete and chat experiences inside VS Code and JetBrains
https://docs.continue.dev/
Apache License 2.0
16.44k stars 1.28k forks source link

VsCodeExtension when listening to config changes is using an inconsistent system file path on windows. #2379

Open al3x-lm opened 4 days ago

al3x-lm commented 4 days ago

Before submitting your bug report

Relevant environment info

- OS:Win
- Continue:0.8.50
- IDE:VSCODE
- Model:1.92.1
- config.json:

Description

The VsCodeExtension file is listening for config changes but it is not getting triggered on windows due to an inconsistency on the system path, one method returns a lower case drive letter on windows and the other returns an upper case drive letter.

filepath === getConfigJsonPath()
c:\Users\snappy\.continue\config.json === C:\Users\snappy\.continue\config.json

I temporarly used filepath.toLowerCase() === getConfigJsonPath().toLowerCase(). Is there a better way to handle the system filepath?

To reproduce

` vscode.workspace.onDidSaveTextDocument(async (event) => { // Listen for file changes in the workspace const filepath = event.uri.fsPath;

  console.log("some file saved");
  console.log("filepath");
  console.log(filepath);
  console.log("getConfigJsonPath()");
  console.log(getConfigJsonPath());

  if (filepath === getConfigJsonPath()) {
    console.log("config saved");`

this returns

`[Extension Host] some file saved
console.ts:137 [Extension Host] filepath
console.ts:137 [Extension Host] c:\Users\snappy\.continue\config.json
console.ts:137 [Extension Host] getConfigJsonPath()
console.ts:137 [Extension Host] C:\Users\snappy\.continue\config.json`

Log output

No response