Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[html] follow id (#) html links #59536

Closed
BartolomeSintes opened this issue Sep 27, 2018 · 4 comments
Closed

[html] follow id (#) html links #59536

BartolomeSintes opened this issue Sep 27, 2018 · 4 comments
Assignees
Labels
feature-request Request for new features or functionality html HTML support issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@BartolomeSintes
Copy link

BartolomeSintes commented Sep 27, 2018

It would be nice if VSCode would open/follow html links to anchors (elements with id attribute).

  1. Target in the same document
    Ctrl+click could be used to scroll down/up to the target element.
    <p>Link to <a href="#target">end of the page</a></p>
    ...
    <p id="target">This is the end, my friends.</p>

  2. Target in another document
    Using Ctrl+click you can open another linked document, but the document is opened at the beginning. It would be nice if VSCode would scroll down to the target.
    Document 1:
    <p>Link to <a href="document-2.html#target">end of another page</a></p>
    Document 2:
    <p>This is the beginning.</p>
    ...
    <p id="target">This is the end, my friends</p>

Thanking you in advance,

@jrieken jrieken assigned aeschli and unassigned jrieken Sep 27, 2018
@aeschli aeschli changed the title Open/follow id (#) html links [html] follow id (#) html links Sep 27, 2018
@aeschli aeschli added this to the Backlog milestone Sep 27, 2018
@aeschli aeschli added html HTML support issues feature-request Request for new features or functionality labels Sep 27, 2018
@saideepd
Copy link

saideepd commented Oct 3, 2018

Hey @aeschli I could do this task of opening link in same document on Ctrl+Click. In which html files it needs to be implemented ?

@aeschli
Copy link
Contributor

aeschli commented Oct 3, 2018

@saideepd Thanks for your interest, you can find the code here: https://github.com/Microsoft/vscode-html-languageservice/blob/5c334c1025e3b5313b30ca82110bad28ddf09aa9/src/services/htmlLinks.ts#L93

Also see the tests there.

The URIs that you return can have the format file:///some/file.js#73,84 (line, column)

@BartolomeSintes
Copy link
Author

Very nice! When will this feature be available in Insiders?

@aeschli aeschli added the verification-needed Verification of issue is requested label Dec 3, 2019
@aeschli
Copy link
Contributor

aeschli commented Dec 3, 2019

To verify create a HTLM document with ids and links that jump to these ids.
Note: Does not work across files!

@jrieken jrieken added the verified Verification succeeded label Dec 3, 2019
@vscodebot vscodebot bot locked and limited conversation to collaborators Dec 29, 2019
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality html HTML support issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

4 participants