jsonLanguageService.d.ts 2.6 KB

12345678910111213141516171819202122232425262728
  1. import { Thenable, ASTNode, Color, ColorInformation, ColorPresentation, LanguageServiceParams, LanguageSettings, DocumentLanguageSettings, FoldingRange, JSONSchema, SelectionRange, FoldingRangesContext, DocumentSymbolsContext, ColorInformationContext as DocumentColorsContext, TextDocument, Position, CompletionItem, CompletionList, Hover, Range, SymbolInformation, Diagnostic, TextEdit, FormattingOptions, DocumentSymbol, DefinitionLink, MatchingSchema } from './jsonLanguageTypes';
  2. import { DocumentLink } from 'vscode-languageserver-types';
  3. export declare type JSONDocument = {
  4. root: ASTNode | undefined;
  5. getNodeFromOffset(offset: number, includeRightBound?: boolean): ASTNode | undefined;
  6. };
  7. export * from './jsonLanguageTypes';
  8. export interface LanguageService {
  9. configure(settings: LanguageSettings): void;
  10. doValidation(document: TextDocument, jsonDocument: JSONDocument, documentSettings?: DocumentLanguageSettings, schema?: JSONSchema): Thenable<Diagnostic[]>;
  11. parseJSONDocument(document: TextDocument): JSONDocument;
  12. newJSONDocument(rootNode: ASTNode, syntaxDiagnostics?: Diagnostic[]): JSONDocument;
  13. resetSchema(uri: string): boolean;
  14. getMatchingSchemas(document: TextDocument, jsonDocument: JSONDocument, schema?: JSONSchema): Thenable<MatchingSchema[]>;
  15. doResolve(item: CompletionItem): Thenable<CompletionItem>;
  16. doComplete(document: TextDocument, position: Position, doc: JSONDocument): Thenable<CompletionList | null>;
  17. findDocumentSymbols(document: TextDocument, doc: JSONDocument, context?: DocumentSymbolsContext): SymbolInformation[];
  18. findDocumentSymbols2(document: TextDocument, doc: JSONDocument, context?: DocumentSymbolsContext): DocumentSymbol[];
  19. findDocumentColors(document: TextDocument, doc: JSONDocument, context?: DocumentColorsContext): Thenable<ColorInformation[]>;
  20. getColorPresentations(document: TextDocument, doc: JSONDocument, color: Color, range: Range): ColorPresentation[];
  21. doHover(document: TextDocument, position: Position, doc: JSONDocument): Thenable<Hover | null>;
  22. format(document: TextDocument, range: Range, options: FormattingOptions): TextEdit[];
  23. getFoldingRanges(document: TextDocument, context?: FoldingRangesContext): FoldingRange[];
  24. getSelectionRanges(document: TextDocument, positions: Position[], doc: JSONDocument): SelectionRange[];
  25. findDefinition(document: TextDocument, position: Position, doc: JSONDocument): Thenable<DefinitionLink[]>;
  26. findLinks(document: TextDocument, doc: JSONDocument): Thenable<DocumentLink[]>;
  27. }
  28. export declare function getLanguageService(params: LanguageServiceParams): LanguageService;