Skip to content

Commit b5fded2

Browse files
committed
Provide default value for getLiquidDocDefinitionsForURI
1 parent 15fc0db commit b5fded2

File tree

2 files changed

+12
-4
lines changed

2 files changed

+12
-4
lines changed

packages/theme-check-common/src/types.ts

+5
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ type MetafieldDefinitionType = {
298298
name: string;
299299
};
300300

301+
export type GetLiquidDocDefinitionsForURI = (
302+
uri: string,
303+
snippetName: string,
304+
) => Promise<LiquidDocDefinition>;
305+
301306
export interface LiquidDocParameter {
302307
name: string;
303308
description: string | null;

packages/theme-language-server-common/src/hover/HoverProvider.ts

+7-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import {
2+
GetLiquidDocDefinitionsForURI,
23
LiquidDocDefinition,
34
MetafieldDefinitionMap,
45
SourceCodeType,
@@ -32,10 +33,12 @@ export class HoverProvider {
3233
readonly getMetafieldDefinitions: (rootUri: string) => Promise<MetafieldDefinitionMap>,
3334
readonly getTranslationsForURI: GetTranslationsForURI = async () => ({}),
3435
readonly getSettingsSchemaForURI: GetThemeSettingsSchemaForURI = async () => [],
35-
readonly getLiquidDocDefinitionsForURI: (
36-
uri: string,
37-
snippetName: string,
38-
) => Promise<LiquidDocDefinition>,
36+
readonly getLiquidDocDefinitionsForURI: GetLiquidDocDefinitionsForURI = async (
37+
_uri,
38+
snippetName,
39+
) => ({
40+
name: snippetName,
41+
}),
3942
) {
4043
const typeSystem = new TypeSystem(
4144
themeDocset,

0 commit comments

Comments
 (0)