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

Support Markdown relative path to folders #91336

Closed
sonofachamp opened this issue Feb 25, 2020 · 14 comments
Closed

Support Markdown relative path to folders #91336

sonofachamp opened this issue Feb 25, 2020 · 14 comments
Assignees
Labels
feature-request Request for new features or functionality markdown Markdown support issues verification-needed Verification of issue is requested verified Verification succeeded
Milestone

Comments

@sonofachamp
Copy link

sonofachamp commented Feb 25, 2020

If I have a [relative path folder link](path/to/something/interesting) it'd be sweet if clicking that link in Markdown preview opened that folder in the VSCode explorer (not Windows). Right now these types of links work on GitHub, but they don't work when Ctrl + clicking them within the Markdown preview in VSCode.

@vscodebot
Copy link

vscodebot bot commented Feb 25, 2020

(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:

@mjbvz mjbvz self-assigned this Feb 25, 2020
@mjbvz mjbvz added help wanted Issues identified as good community contribution opportunities markdown Markdown support issues labels Mar 6, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Mar 6, 2020

Is this the same request as #90956?

@sonofachamp
Copy link
Author

@mjbvz I don't think so. The paths being relative to the .md file location is fine, but if I link to a folder instead of a file I'd like that folder to open in the Explorer window within VSCode.

@mjbvz
Copy link
Contributor

mjbvz commented Mar 6, 2020

Thanks for the clarification. PRs welcome for this

@mjbvz mjbvz added the good first issue Issues identified as good for first-time contributors label Mar 6, 2020
@dormesica
Copy link
Contributor

I would like to help with this.
Can I get some direction on where to start looking?

@mjbvz
Copy link
Contributor

mjbvz commented Mar 9, 2020

Here's the code the I believe handles this:

public execute(args: OpenDocumentLinkArgs) {

You likely need to check if the link points to a folder and handle that case. Try debugging through to see if that's the case

@dormesica
Copy link
Contributor

I think I undersand what's happenings there:

return this.tryOpen(targetPath, args, column).catch(() => {
if (targetPath && extname(targetPath) === '') {
return this.tryOpen(targetPath + '.md', args, column);
}

The first call to tryOpen fails because because targetPath points to a folder not a file. Then, there is an attempt to add the .md extension to the path which fails bacause there is not such flie which causes something like unhandled promise rejection.

I didn't find any command that reveals the folder row in the explorer. Using vscode.commands.executeCommand('vscode.open', uri); works but shows a notification error saying "Unable to open ... file is a directory".

@mjbvz
Copy link
Contributor

mjbvz commented Mar 16, 2020

@isidorn Is there a command that reveals a folder in the explorer?

@isidorn
Copy link
Contributor

isidorn commented Mar 16, 2020

@mjbvz no, there is only Reveal Active File in SideBar.

@dormesica
Copy link
Contributor

@isidorn Is it possible to expose such a command? I wouldn't mind giving a hand.

@isidorn
Copy link
Contributor

isidorn commented Mar 18, 2020

@dormesica not right now, but we might consider adding it in the future if there appear more use cases for it.

@mjbvz mjbvz added feature-request Request for new features or functionality and removed good first issue Issues identified as good for first-time contributors help wanted Issues identified as good community contribution opportunities labels Mar 19, 2020
@mjbvz
Copy link
Contributor

mjbvz commented Mar 19, 2020

Ok, I'm unmarking this as help wanted then and marking as a feature request so we can gauge interest.

Thanks for investigating this @dormesica!

@vscodebot vscodebot bot added this to the Backlog Candidates milestone Mar 19, 2020
@vscodebot
Copy link

vscodebot bot commented Mar 19, 2020

This feature request is now a candidate for our backlog. The community has 60 days to upvote the issue. If it receives 20 upvotes we will move it to our backlog. If not, we will close it. To learn more about how we handle feature requests, please see our documentation.

Happy Coding!

@memark
Copy link

memark commented Mar 20, 2020

@mjbvz This issue still shows up under "Good first issues", which I assume it shouldn't since you removed those tags.

@mjbvz mjbvz modified the milestones: Backlog Candidates, April 2020 Apr 13, 2020
@mjbvz mjbvz closed this as completed in e7bc301 Apr 13, 2020
@mjbvz mjbvz added the verification-needed Verification of issue is requested label Apr 13, 2020
@roblourens roblourens added the verified Verification succeeded label Apr 29, 2020
@github-actions github-actions bot locked and limited conversation to collaborators May 28, 2020
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 markdown Markdown support issues verification-needed Verification of issue is requested verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants