|
5 | 5 | *--------------------------------------------------------------------------------------------*/ |
6 | 6 |
|
7 | 7 | import { YAMLSchemaService, CustomSchemaProvider, SchemaAdditions, SchemaDeletions } from './services/yamlSchemaService'; |
8 | | -import { TextDocument, Position, CompletionList, Diagnostic, Hover, SymbolInformation, DocumentSymbol, CompletionItem, TextEdit } from 'vscode-languageserver-types'; |
| 8 | +import { TextDocument, Position, CompletionList, Diagnostic, Hover, SymbolInformation, DocumentSymbol, CompletionItem, TextEdit, DefinitionLink } from 'vscode-languageserver-types'; |
9 | 9 | import { JSONSchema } from './jsonSchema'; |
10 | 10 | import { YAMLDocumentSymbols } from './services/documentSymbols'; |
11 | 11 | import { YAMLCompletion } from './services/yamlCompletion'; |
12 | 12 | import { YAMLHover } from './services/yamlHover'; |
13 | 13 | import { YAMLValidation } from './services/yamlValidation'; |
14 | 14 | import { YAMLFormatter } from './services/yamlFormatter'; |
15 | 15 | import { getLanguageService as getJSONLanguageService, JSONWorkerContribution } from 'vscode-json-languageservice'; |
| 16 | +import { findDefinition } from './services/yamlDefinition'; |
16 | 17 |
|
17 | 18 | export interface LanguageSettings { |
18 | 19 | validate?: boolean; //Setting for whether we want to validate the schema |
@@ -116,6 +117,7 @@ export interface LanguageService { |
116 | 117 | findDocumentSymbols(document: TextDocument): SymbolInformation[]; |
117 | 118 | findDocumentSymbols2(document: TextDocument): DocumentSymbol[]; |
118 | 119 | doResolve(completionItem): Thenable<CompletionItem>; |
| 120 | + findDefinition(document: TextDocument, position: Position): Thenable<DefinitionLink[]>; |
119 | 121 | resetSchema(uri: string): boolean; |
120 | 122 | doFormat(document: TextDocument, options: CustomFormatterOptions): TextEdit[]; |
121 | 123 | addSchema(schemaID: string, schema: JSONSchema): void; |
@@ -154,6 +156,7 @@ export function getLanguageService(schemaRequestService: SchemaRequestService, |
154 | 156 | registerCustomSchemaProvider: (schemaProvider: CustomSchemaProvider) => { |
155 | 157 | schemaService.registerCustomSchemaProvider(schemaProvider); |
156 | 158 | }, |
| 159 | + findDefinition, |
157 | 160 | doComplete: completer.doComplete.bind(completer), |
158 | 161 | doResolve: completer.doResolve.bind(completer), |
159 | 162 | doValidation: yamlValidation.doValidation.bind(yamlValidation), |
|
0 commit comments