Skip to content

Commit 995d3cf

Browse files
committed
fix: pr fb
1 parent 1f9c491 commit 995d3cf

2 files changed

Lines changed: 10 additions & 12 deletions

File tree

packages/salesforcedx-lightning-lsp-common/src/workspaceReadFileHandler.ts

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -97,14 +97,15 @@ export const registerWorkspaceReadFileHandler = (
9797
params: WorkspaceReadDirectoryParams
9898
) {
9999
const { uri } = params;
100-
yield* logTo(log, `[readDirectory] request uri=${uri.toString()}`);
101-
const entries = yield* Effect.tryPromise(() => vscode.workspace.fs.readDirectory(uri));
100+
const vUri = vscode.Uri.parse(uri.toString());
101+
yield* logTo(log, `[readDirectory] request uri=${vUri.toString()}`);
102+
const entries = yield* Effect.tryPromise(() => vscode.workspace.fs.readDirectory(vUri));
102103
const result: DirectoryEntry[] = entries.map(([name, fileType]) => ({
103104
name,
104105
type: vscodeFileTypeToStatType(fileType),
105-
uri: vscode.Uri.joinPath(uri, name).toString()
106+
uri: vscode.Uri.joinPath(vUri, name).toString()
106107
}));
107-
yield* logTo(log, `[readDirectory] success uri=${uri.toString()} entries=${result.length}`);
108+
yield* logTo(log, `[readDirectory] success uri=${vUri.toString()} entries=${result.length}`);
108109
return { entries: result };
109110
});
110111

packages/salesforcedx-lwc-language-server/src/typingIndexer.ts

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -130,15 +130,12 @@ export const getMetaTypings = async (indexer: TypingIndexerData): Promise<string
130130

131131
// Utility function to get custom label files
132132
const getCustomLabelFiles = async (indexer: TypingIndexerData): Promise<string[]> => {
133-
// For mock file system, check for the specific custom labels file
134-
const customLabelsPath = path.join(
135-
indexer.workspaceRoot,
136-
'force-app/main/default/labels/CustomLabels.labels-meta.xml'
133+
const packageDirsPattern = await getSfdxPackageDirsPattern(indexer.workspaceRoot, indexer.fileSystemAccessor);
134+
const found = await indexer.fileSystemAccessor.findFilesWithGlobAsync(
135+
`${packageDirsPattern}/**/labels/CustomLabels.labels-meta.xml`,
136+
indexer.workspaceRoot
137137
);
138-
if (await indexer.fileSystemAccessor.fileExists(normalizePath(customLabelsPath))) {
139-
return [customLabelsPath];
140-
}
141-
return [];
138+
return found ?? [];
142139
};
143140

144141
// Legacy class for backward compatibility (deprecated)

0 commit comments

Comments
 (0)