diff --git a/packages/vscode-pv-handlebars-language-server/server/src/definitionProvider.ts b/packages/vscode-pv-handlebars-language-server/server/src/definitionProvider.ts index e7e82b3..a5f14e5 100644 --- a/packages/vscode-pv-handlebars-language-server/server/src/definitionProvider.ts +++ b/packages/vscode-pv-handlebars-language-server/server/src/definitionProvider.ts @@ -59,7 +59,9 @@ export async function definitionProvider( ? `${filePath.split("/frontend/src/components")[0]}/frontend/src/components` : filePath.includes("src/pages/") ? `${filePath.split("/frontend/src/pages")[0]}/frontend/src/components` - : `${filePath.split("/frontend/src/layouts")[0]}/frontend/src/components`; + : filePath.includes("src/layouts/") + ? `${filePath.split("/frontend/src/layouts")[0]}/frontend/src/components` + : `${filePath.split("/frontend/src/templates")[0]}/frontend/src/components`; // e.g. {{> partial if (isPartial(textBefore)) { diff --git a/packages/vscode-pv-handlebars-language-server/server/src/helpers.ts b/packages/vscode-pv-handlebars-language-server/server/src/helpers.ts index c6c5da0..6b1c3a1 100644 --- a/packages/vscode-pv-handlebars-language-server/server/src/helpers.ts +++ b/packages/vscode-pv-handlebars-language-server/server/src/helpers.ts @@ -77,7 +77,8 @@ export function isPVArchetype(templatePath: string): boolean { return ( templatePath.includes("/frontend/src/components") || templatePath.includes("/frontend/src/pages") || - templatePath.includes("/frontend/src/layouts") + templatePath.includes("/frontend/src/layouts") || + templatePath.includes("/frontend/src/templates") ); }