Skip to content

Commit

Permalink
Enable workspace references + Add delay
Browse files Browse the repository at this point in the history
  • Loading branch information
cooolbros committed Nov 27, 2024
1 parent 4d90e84 commit a626f28
Showing 1 changed file with 22 additions and 21 deletions.
43 changes: 22 additions & 21 deletions packages/server/src/VDF/VGUI/VGUIWorkspace.ts
Original file line number Diff line number Diff line change
Expand Up @@ -367,33 +367,34 @@ export class VGUIWorkspace extends WorkspaceBase {
this.workspaceReferencesReady = promise

firstValueFrom(fileSystem$).then(async (fileSystem) => {
const [clientSchemeFiles, sourceSchemeFiles, languageTokenFiles] = await Promise.all([
firstValueFrom(this.clientSchemeFiles$),
firstValueFrom(this.sourceSchemeFiles$),
firstValueFrom(this.languageTokensFiles$),
])

// const [clientSchemeFiles, sourceSchemeFiles, languageTokenFiles] = await Promise.all([
// firstValueFrom(this.clientSchemeFiles$),
// firstValueFrom(this.sourceSchemeFiles$),
// firstValueFrom(this.languageTokensFiles$),
// ])
const entries = await fileSystem.readDirectory("resource/ui", { recursive: true, pattern: "**/*.res" })

// const entries = await fileSystem.readDirectory("resource/ui", { recursive: true, pattern: "**/*.res" })
const promises: Promise<void>[] = []

// const promises: Promise<void>[] = []

// for (const [name, type] of entries) {
for (const [name, type] of entries) {
if (type == 2 || clientSchemeFiles.has(name) || sourceSchemeFiles.has(name) || languageTokenFiles.has(name)) {
continue
}

// if (type == 2 || clientSchemeFiles.has(name) || sourceSchemeFiles.has(name) || languageTokenFiles.has(name)) {
// continue
// }
const { promise, resolve } = Promise.withResolvers<void>()
promises.push(promise)

// promises.push(
// firstValueFrom(fileSystem.resolveFile(name)).then(async (uri) => {
// if (uri) {
// await firstValueFrom((await documents.get(uri, true)).definitionReferences$)
// }
// })
// )
// }
setTimeout(async () => {
const uri = await firstValueFrom(fileSystem.resolveFile(name))
if (uri) {
await firstValueFrom((await documents.get(uri, true)).definitionReferences$)
}
resolve()
}, 0)
}

// await Promise.allSettled(promises)
await Promise.allSettled(promises)
resolve()
})
}
Expand Down

0 comments on commit a626f28

Please sign in to comment.