yzhang-gh / vscode-markdown

Markdown All in One
https://marketplace.visualstudio.com/items?itemName=yzhang.markdown-all-in-one
MIT License
2.91k stars 322 forks source link

support angle brackets in path completion #1410

Open gmccullo opened 6 months ago

gmccullo commented 6 months ago

Proposal

Path completion should not encode link paths inside angle brackets.

For example when linking to a file named "foo bar.md", the space is encoded: [foo bar](../folder2/foo%20bar.md). This is true even if you use angle brackets: [foo bar](<../folder2/foo%20bar.md>). But vscode's built-in path completion is different: when using angle brackets the space is not encoded: [foo bar](<../folder2/foo bar.md>). That's what we want.

Other information

yzhang-gh commented 6 months ago

That's strange. As far I can see, this extension does not complete paths in angle brackets

https://github.com/yzhang-gh/vscode-markdown/blob/d2862ca363656c244ff587e6ce17e875e02457ed/src/completion.ts#L186-L191

image

I also tried on my machine and it did have no completion.

gmccullo commented 6 months ago

It does for me. I tried it with no other extensions enabled. However I do have to manually trigger Intellisense with ctrl-space.

yzhang-gh commented 6 months ago

What if you also disable this extension 😂

gmccullo commented 6 months ago

Here's a demo.

https://github.com/yzhang-gh/vscode-markdown/assets/26315643/f0cc235e-e0ad-44d6-9b17-751d9191e367

yzhang-gh commented 6 months ago

Thanks for the video. I finally realized it is <> inside (), never knew this syntax before 😂.

I may not have enough time this week. It would be better if anyone is willing to help. (Guess it is as easy as adding an if checking whether lineTextBefore starts with <)