@shopify/theme-language-server-common
Version:
<h1 align="center" style="position: relative;" > <br> <img src="https://github.com/Shopify/theme-check-vscode/blob/main/images/shopify_glyph.png?raw=true" alt="logo" width="141" height="160"> <br> Theme Language Server </h1>
27 lines (26 loc) • 1.6 kB
TypeScript
import { LiquidRawTag } from '@shopify/liquid-html-parser';
import { LiquidHtmlNode } from '@shopify/theme-check-common';
import { CompletionsCollector, JSONPath, JSONWorkerContribution } from 'vscode-json-languageservice';
import { DocumentManager } from '../documents';
import { GetTranslationsForURI } from '../translations';
/**
* This contribution is responsible for providing completions and hover of
* `t:` translations in sections and blocks {% schema %} JSON blobs.
*/
export declare class SchemaTranslationContributions implements JSONWorkerContribution {
private documentManager;
private getDefaultSchemaTranslations;
private uriPatterns;
constructor(documentManager: DocumentManager, getDefaultSchemaTranslations: GetTranslationsForURI);
/**
* Because the API for JSONWorkerContribution is slightly weird, we need to
* return undefined (not Promise<undefined>) for this contribution to be
* skipped and fallbacks to go through. It's not typed properly either.
*/
getInfoContribution(uri: string, location: JSONPath): Promise<string[]>;
collectValueCompletions(uri: string, location: JSONPath, propertyKey: string, result: CompletionsCollector): Promise<void>;
collectDefaultCompletions(_uri: string, _result: CompletionsCollector): Promise<void>;
collectPropertyCompletions(_uri: string, _location: JSONPath, _currentWord: string, _addValue: boolean, _isLast: boolean, _result: CompletionsCollector): Promise<void>;
private recommendTranslations;
}
export declare function findSchemaNode(ast: LiquidHtmlNode): LiquidRawTag;