Skip to content

Commit

Permalink
fix(psr4): start looking up from proper directory
Browse files Browse the repository at this point in the history
  • Loading branch information
innocenzi committed Sep 23, 2024
1 parent eef34e1 commit b1e7d04
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/psr4.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export interface PhpFile {

export async function getComposerAutoloadPsr4(fromFile: Uri, workspace: Uri): Promise<[string, Autoload['psr-4']]> {
// TODO: cache
const file = await findFile('composer.json', { startingFrom: dirname(fromFile.fsPath) })
const file = await findFile('composer.json', { startingFrom: fromFile.fsPath })
if (!file) {
return [workspace.fsPath, {}]
}
Expand Down Expand Up @@ -92,7 +92,7 @@ export async function resolvePhpFile(workspace: Uri, file: Uri): Promise<PhpFile
}

export async function fqcnToFile(workspace: Uri, fqcn: string): Promise<string> {
const [root, psr4] = await getComposerAutoloadPsr4(workspace, workspace)
const [_, psr4] = await getComposerAutoloadPsr4(workspace, workspace)

fqcn = fqcn.replaceAll('\\\\', '\\')

Expand Down

0 comments on commit b1e7d04

Please sign in to comment.