trypear / pearai-app

The Open Source AI-Powered Code Editor. A fork of VSCode and Continue.
https://trypear.ai
Other
574 stars 95 forks source link

Build is not recompiling correctly #9

Closed Fryingpannn closed 1 month ago

Fryingpannn commented 2 months ago

I made a change in the auxiliaryBarActions.ts file and changed a key binding. I ran the script to start/debug the app but the change was not reflected until I removed the out folder which contains the build (rm -rf out ) and re-ran the script.

Seems like the build is caching changes when it should not.

Trifall commented 2 months ago

I ran a test of change the auxiliaryBarActions.ts file myself and changed the semicolon keybind to the quote key instead, and it worked for me without having to rebuild.

Steps I followed:

  1. I used the my main VS Code (CTRL+SHIFT+B) to run the build steps (Can use yarn watch if building from terminal)
  2. I then ran ./scripts/code.sh in the source directory as per the build guide
  3. Once new editor loaded, I tested the original semicolon hotkey (worked)
  4. Went to VS Code editor and changed hotkey to quote instead
  5. Went back to new editor and pressed (CTRL+R) to reload the window
  6. Hotkey now switched to quote key correctly
Fryingpannn commented 2 months ago

@Trifall Interesting, I will test this out again! Ty

Trifall commented 2 months ago

I just retested this, and it updates correctly with CTRL+R for me when I edit auxiliaryBarActions.ts, but when I modify code inside of the pearai-extension folder i.e extensions/pearai-extension/lib/extension/src/extension.ts, it doesn't reload/update those changes until I rerun ./scripts/code.sh and nx rebuilds the extensions and webview. Not sure how to get it to fast reload those.

If I had to guess it might have to do with Gulp not watching the pearai-extension in the watch-extensions script for some reason.

Fryingpannn commented 1 month ago

Interesting. I cannot even get it to start when running through your steps.

If I do yarn watch first, then running the script, I get this error:

[Error: ENOENT: no such file or directory, open '/Users/fryingpan/code/pearai-app/out/vs/code/electron-main/main.js'] {
  errno: -2,
  code: 'ENOENT',
  syscall: 'open',
  path: '/Users/fryingpan/code/pearai-app/out/vs/code/electron-main/main.js',
  phase: 'loading',
  moduleId: 'vs/code/electron-main/main',
  neededBy: [ '===anonymous1===' ]
}

In order to run it, I must rm -rf out, then directly run the script (with no yarn watch).

Your way of doing it seems like expected behaviour. We'll see if others also have my problem.

Regarding the pearai-extension directory, it's possible it's because the yarn watch isn't watching that specific folder. There's probably a way to add it. I'll make an issue for it.