diff options
Diffstat (limited to 'extensions/markdown-language-features/src/languageFeatures/definitions.ts')
-rw-r--r-- | extensions/markdown-language-features/src/languageFeatures/definitions.ts | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/extensions/markdown-language-features/src/languageFeatures/definitions.ts b/extensions/markdown-language-features/src/languageFeatures/definitions.ts deleted file mode 100644 index d080dcaab1a..00000000000 --- a/extensions/markdown-language-features/src/languageFeatures/definitions.ts +++ /dev/null @@ -1,27 +0,0 @@ -/*--------------------------------------------------------------------------------------------- - * Copyright (c) Microsoft Corporation. All rights reserved. - * Licensed under the MIT License. See License.txt in the project root for license information. - *--------------------------------------------------------------------------------------------*/ -import * as vscode from 'vscode'; -import { ITextDocument } from '../types/textDocument'; -import { MdReferencesProvider } from './references'; - -export class MdVsCodeDefinitionProvider implements vscode.DefinitionProvider { - - constructor( - private readonly referencesProvider: MdReferencesProvider, - ) { } - - async provideDefinition(document: ITextDocument, position: vscode.Position, token: vscode.CancellationToken): Promise<vscode.Definition | undefined> { - const allRefs = await this.referencesProvider.getReferencesAtPosition(document, position, token); - - return allRefs.find(ref => ref.kind === 'link' && ref.isDefinition)?.location; - } -} - -export function registerDefinitionSupport( - selector: vscode.DocumentSelector, - referencesProvider: MdReferencesProvider, -): vscode.Disposable { - return vscode.languages.registerDefinitionProvider(selector, new MdVsCodeDefinitionProvider(referencesProvider)); -} |