Skip to content

Commit

Permalink
fix(vscode): registerUnocss cache rules (#3428)
Browse files Browse the repository at this point in the history
  • Loading branch information
Simon-He95 committed Dec 7, 2023
1 parent 0d463d0 commit 0ccde55
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions packages/vscode/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,26 +97,23 @@ async function rootRegister(
if (cacheFileLookUp.has(url))
return

if (!filter(url)) {
cacheFileLookUp.add(url)
if (!filter(url))
return
}

if ([...rootCache].some(root => url.startsWith(root))) {
// root has been created
cacheFileLookUp.add(url)
cacheFileLookUp.add(url)

// root has been created
if ([...rootCache].some(root => url.startsWith(root)))
return
}

const configUrl = await findUp(configNames, { cwd: url })

cacheFileLookUp.add(url)

if (!configUrl)
return

const cwd = path.dirname(configUrl)
rootCache.add(cwd)
// Prevent sub-repositories from having the same naming prefix
rootCache.add(`${cwd}/`)

await ctx.loadContextInDirectory(cwd)
}
Expand Down

0 comments on commit 0ccde55

Please sign in to comment.