Skip to content

Commit

Permalink
Merge pull request #3137 from 0xBigBoss/allen/fix-unhandled-ignores-r…
Browse files Browse the repository at this point in the history
…ange-error

fix: handle RangeError during didChangeActiveTextEditor
  • Loading branch information
sestinj authored Nov 30, 2024
2 parents bd66c85 + 1db3a87 commit d2ac0d9
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions core/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -775,8 +775,16 @@ export class Core {
const ignoreInstance = ignore().add(defaultIgnoreFile);
let rootDirectory = await this.ide.getWorkspaceDirs();
const relativeFilePath = path.relative(rootDirectory[0], filepath);
if (!ignoreInstance.ignores(relativeFilePath)) {
recentlyEditedFilesCache.set(filepath, filepath);
try {
if (!ignoreInstance.ignores(relativeFilePath)) {
recentlyEditedFilesCache.set(filepath, filepath);
}
} catch (e) {
if (e instanceof RangeError) {
// do nothing, this can happen when editing a file outside the workspace such as `../extensions/.continue-debug/config.json`
} else {
console.debug("unhandled ignores error", relativeFilePath, e);
}
}
});

Expand Down

0 comments on commit d2ac0d9

Please sign in to comment.