Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Feature: Implement Goto Definition (textDocument/definition) handler #2

Open
bryphe opened this issue Dec 31, 2017 · 3 comments
Open

Comments

@bryphe
Copy link
Member

bryphe commented Dec 31, 2017

This is tracking implementation of the textDocument/definition handler.

For Markdown files, this is especially useful when there is a relative URL called out, like:

[example](./examples/example.md). 

Ideally, when the cursor is over example, we could send a response that joins the path of the current file with the relative file path as the location.

In addition, it would be great to handle cases where an anchor/marker is specified, like:

[first example](./examples/example.md#first)

In this case, as part of the definition response, we should send a Range that corresponds to the first anchor in example.md

@bryphe
Copy link
Member Author

bryphe commented Dec 31, 2017

Actually - I wonder if this is more appropriate to use the textDocument/documentLink request?

@DeltaEvo
Copy link
Contributor

DeltaEvo commented Dec 31, 2017

A textDocument/documentLink seems more appropriate because DocumentLink links to an internal or external resource so we can cover all type of links in a markdown document.

But I don't know how this is implemented in the Client's Side and if the link refer to an internal ressource, the Client handle it like textDocument/definition by providing a goto ?

If not we can implement textDocument/definition too

PS: In vscode the link is underlined and a Ctrl+Click open it

@DeltaEvo
Copy link
Contributor

For information vscode-html-languageservice only implement textDocument/documentLink by searching all href and src in the attributes of the nodes in the document

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants