Skip to content

Commit 846b966

Browse files
authored
Merge pull request #857 from Shopify/allow-recommendations-in-blocks
Allow recommendations in blocks
2 parents ea80152 + 0fb231c commit 846b966

File tree

3 files changed

+8
-2
lines changed

3 files changed

+8
-2
lines changed

.changeset/slimy-stingrays-smile.md

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@shopify/theme-check-common': minor
3+
'@shopify/theme-language-server-common': minor
4+
---
5+
6+
Allow `recommendations` as a global variable in `blocks/`

packages/theme-check-common/src/checks/undefined-object/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ function getContextualObjects(relativePath: string): string[] {
191191
}
192192

193193
if (relativePath.startsWith('blocks/')) {
194-
return ['app', 'section', 'block'];
194+
return ['app', 'section', 'recommendations', 'block'];
195195
}
196196

197197
if (relativePath.startsWith('snippets/')) {

packages/theme-language-server-common/src/TypeSystem.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,7 @@ function getContextualEntries(uri: string): string[] {
352352
return ['section', 'predictive_search', 'recommendations', 'comment'];
353353
}
354354
if (BLOCK_FILE_REGEX.test(normalizedUri)) {
355-
return ['app', 'section', 'block'];
355+
return ['app', 'section', 'recommendations', 'block'];
356356
}
357357
if (SNIPPET_FILE_REGEX.test(normalizedUri)) {
358358
return ['app'];

0 commit comments

Comments
 (0)