|
@@ -968,9 +968,11 @@ export namespace SessionPrompt {
|
|
|
// have to normalize, symbol search returns absolute paths
|
|
// have to normalize, symbol search returns absolute paths
|
|
|
// Decode the pathname since URL constructor doesn't automatically decode it
|
|
// Decode the pathname since URL constructor doesn't automatically decode it
|
|
|
const filepath = fileURLToPath(part.url)
|
|
const filepath = fileURLToPath(part.url)
|
|
|
- const stat = await Bun.file(filepath).stat()
|
|
|
|
|
|
|
+ const stat = await Bun.file(filepath)
|
|
|
|
|
+ .stat()
|
|
|
|
|
+ .catch(() => undefined)
|
|
|
|
|
|
|
|
- if (stat.isDirectory()) {
|
|
|
|
|
|
|
+ if (stat?.isDirectory()) {
|
|
|
part.mime = "application/x-directory"
|
|
part.mime = "application/x-directory"
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -989,7 +991,7 @@ export namespace SessionPrompt {
|
|
|
// workspace/symbol searches, so we'll try to find the
|
|
// workspace/symbol searches, so we'll try to find the
|
|
|
// symbol in the document to get the full range
|
|
// symbol in the document to get the full range
|
|
|
if (start === end) {
|
|
if (start === end) {
|
|
|
- const symbols = await LSP.documentSymbol(filePathURI)
|
|
|
|
|
|
|
+ const symbols = await LSP.documentSymbol(filePathURI).catch(() => [])
|
|
|
for (const symbol of symbols) {
|
|
for (const symbol of symbols) {
|
|
|
let range: LSP.Range | undefined
|
|
let range: LSP.Range | undefined
|
|
|
if ("range" in symbol) {
|
|
if ("range" in symbol) {
|