Skip to content

Commit

Permalink
Add hooks before initializing the workspace
Browse files Browse the repository at this point in the history
  • Loading branch information
georg-schwarz committed Jul 26, 2024
1 parent b9abbaa commit 953ec48
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,18 +45,19 @@ export async function initializeWorkspace(
services: JayveeServices,
workspaceFolders: WorkspaceFolder[] = [],
): Promise<void> {
addCollectUnresolvedImportHook(services);

await services.shared.workspace.WorkspaceManager.initializeWorkspace(
workspaceFolders,
);

addCollectUnresolvedImportHook(services);
}

function addCollectUnresolvedImportHook(services: JayveeServices): void {
const documentBuilder = services.shared.workspace.DocumentBuilder;
const importResolver = services.ImportResolver;

documentBuilder.onBuildPhase(DocumentState.IndexedContent, async (docs) => {
console.log('triggered');
for (const doc of docs) {
const model = doc.parseResult.value;
if (!isJayveeModel(model)) {
Expand Down

0 comments on commit 953ec48

Please sign in to comment.