UNPKG

yaml-language-server

Version:
78 lines (77 loc) 3.23 kB
import type { TextDocument } from 'vscode-languageserver-textdocument'; import type { ClientCapabilities } from 'vscode-languageserver'; import { CompletionItem as CompletionItemBase, CompletionList, Position } from 'vscode-languageserver-types'; import type { Telemetry } from '../telemetry'; import type { YamlDocuments } from '../parser/yaml-documents'; import type { LanguageSettings } from '../yamlLanguageService'; import type { YAMLSchemaService } from './yamlSchemaService'; import type { JSONSchema } from '../jsonSchema'; import type { SettingsState } from '../../yamlSettings'; interface ParentCompletionItemOptions { schema: JSONSchema; indent?: string; insertTexts?: string[]; } interface CompletionItem extends CompletionItemBase { parent?: ParentCompletionItemOptions; } export declare class YamlCompletion { private schemaService; private clientCapabilities; private yamlDocument; private readonly telemetry?; private customTags; private completionEnabled; private configuredIndentation; private yamlVersion; private isSingleQuote; private indentation; private arrayPrefixIndentation; private supportsMarkdown; private disableDefaultProperties; private parentSkeletonSelectedFirst; constructor(schemaService: YAMLSchemaService, clientCapabilities: ClientCapabilities, yamlDocument: YamlDocuments, telemetry?: Telemetry); configure(languageSettings: LanguageSettings, yamlSettings?: SettingsState): void; doComplete(document: TextDocument, position: Position, isKubernetes?: boolean, doComplete?: boolean): Promise<CompletionList>; updateCompletionText(completionItem: CompletionItem, text: string): void; mergeSimpleInsertTexts(label: string, existingText: string, addingText: string, oneOfSchema: boolean): string | undefined; getValuesFromInsertText(insertText: string): string[]; private finalizeParentCompletion; private createTempObjNode; private addPropertyCompletions; private getValueCompletions; private addArrayItemValueCompletion; private getInsertTextForProperty; private getInsertTextForObject; private getInsertTextForArray; private getInsertTextForGuessedValue; private getInsertTextForPlainText; private getInsertTextForValue; private getInsertTemplateForValue; private addSchemaValueCompletions; private collectTypes; private addDefaultValueCompletions; private addEnumValueCompletions; private getLabelForValue; private collectDefaultSnippets; private getInsertTextForSnippetValue; private addBooleanValueCompletion; private addNullValueCompletion; private getLabelForSnippetValue; private getCustomTagValueCompletions; private addCustomTagValueCompletion; private getDocumentationWithMarkdownText; private getSuggestionKind; private getCurrentWord; private fromMarkup; private doesSupportMarkdown; private findItemAtOffset; private getPropertyNamesCandidates; getQuote(): string; /** * simplify `{$1:value}` to `value` */ evaluateTab1Symbol(value: string): string; isParentCompletionItem(item: CompletionItemBase): item is CompletionItem; } export {};