Skip to content

Commit

Permalink
Provide default value for getLiquidDocDefinitionsForURI
Browse files Browse the repository at this point in the history
  • Loading branch information
jamesmengo committed Jan 17, 2025
1 parent 15fc0db commit b5fded2
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
5 changes: 5 additions & 0 deletions packages/theme-check-common/src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,11 @@ type MetafieldDefinitionType = {
name: string;
};

export type GetLiquidDocDefinitionsForURI = (
uri: string,
snippetName: string,
) => Promise<LiquidDocDefinition>;

export interface LiquidDocParameter {
name: string;
description: string | null;
Expand Down
11 changes: 7 additions & 4 deletions packages/theme-language-server-common/src/hover/HoverProvider.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import {
GetLiquidDocDefinitionsForURI,
LiquidDocDefinition,
MetafieldDefinitionMap,
SourceCodeType,
Expand Down Expand Up @@ -32,10 +33,12 @@ export class HoverProvider {
readonly getMetafieldDefinitions: (rootUri: string) => Promise<MetafieldDefinitionMap>,
readonly getTranslationsForURI: GetTranslationsForURI = async () => ({}),
readonly getSettingsSchemaForURI: GetThemeSettingsSchemaForURI = async () => [],
readonly getLiquidDocDefinitionsForURI: (
uri: string,
snippetName: string,
) => Promise<LiquidDocDefinition>,
readonly getLiquidDocDefinitionsForURI: GetLiquidDocDefinitionsForURI = async (
_uri,
snippetName,
) => ({
name: snippetName,
}),
) {
const typeSystem = new TypeSystem(
themeDocset,
Expand Down

0 comments on commit b5fded2

Please sign in to comment.